This topic is locked

Number formats without .00?

2/15/2006 6:58:25 PM
ASPRunnerPro General questions
P
pvsmith author

To display numbers on the List page without the ".00", what do I need to do if they're not ZIP codes? It is confusing to me in the Edit Format page. Thank you. (I posted this previously under my post yesterday. Sorry about the duplicate post. But I hope there's somebody out there who can answer.)

Sergey Kornilov admin 2/16/2006

Hi,
To display numbers on the List page without the ".00" please select empty line in View As dropdown box on Formatting Tab.

lefty 2/26/2006

Hi,

To display numbers on the List page without the ".00" please select empty line in View As dropdown box on Formatting Tab.


I have the same problem . I need the numbers on the list page to exclude decimals. Where is the dropdown box option in the view as tab? Also that field has to be selected as a number as my sql query for that field won't work with text.

Sergey Kornilov admin 2/26/2006

John,
if you do not set any "View as" format database values will be displayed as is.
What are actual values in your database that you need to display without decimals?

lefty 2/27/2006

The actual values on the list/view pages show up as for example 4.00 . I need to get rid of the decimal as my field needs to show for example 4 instead of 4.00. I used the view and edit as a number in asprunner pro. If I select as none than it thinks it's text and I cannot use calculations later.

P
pvsmith author 2/27/2006

John,
What Sergey says is correct. The only way I've been able to get the "not item selected" to do what it needs to do with the decimals is to start the entire project over. Yes, it is an headache, but it does work. For some reason, it appears that once you've selected a number in the list and then you try to un-select it, you keep on getting decimals. But once I started completely over, and was careful in what I selected, it did what it was supposed to do.

Sergey Kornilov admin 2/27/2006

John,
what is the actual field type in the database and what values are there?
If you need to drop digits after comma you can use FormatNumber function which takes number of digits after comma as a second parameter. More info: http://msdn.microsoft.com/library/default....ormatnumber.asp
You can set "View as" to Number and modify GetData function in include/aspfunctions.asp file to have no digits after comma.