...

View Full Version : Converting to percentage



WoG
12-07-2004, 09:23 PM
I want to make a calculation on two numbers, (divide one into another) and display the result with the following format:
##.##%

Here is what I have for the calculation:
LAS_diff_perc = CInt(LAS_diff)/CInt(LASprev)
Response.Write (LAS_diff_perc)

Obviously, I get something like this:
0.612903225806452

How do I get the result with only 2 decimals past the decimal point?

Thanks!

Brandoe85
12-08-2004, 01:10 AM
try this:


LAS_diff_perc = CInt(LAS_diff)/CInt(LASprev) * 100
Response.Write (round(LAS_diff_perc,2))



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum