View Full Version : Converting to percentage

12-07-2004, 08: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:

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


12-08-2004, 12: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