Click to See Complete Forum and Search --> : Showing numeric variables to 2 decimal places


gowans007
12-16-2008, 03:38 PM
I am reading data as type float from a SQL database.

After this I either want to display or run a calculation and display to two decimal places.

I have rounded to that a number to many points can be show to the most two decimal places but I also want to show whole numbers and tenths to two points.

How can I force this.

i.e.

5 to be 5.00
5.5 to be 5.50
5.4768979 to be 5.48

Kuriyama
12-17-2008, 08:56 AM
http://www.google.com/search?hl=en&q=ASP+Round+to+two+decimal+places&btnG=Google+Search&aq=f&oq=

Google. . .it's your friend.

If round not displaying 5 as 5.00 then just manually append those digits. Also, if you are trying to display these values a currency, which I suspect you are, use the formatCurrency function.