Helpful Information
 
 
Category: Flash Help
Whole numbers to Float

Using actionscript how would I convert a long decimal number to only .00

eg:
45.667783948534

to:
45.67

?????????

any suggestions will be appreciated.
Thanks!

orgNum=46.5689890;
newNum=((Math.round(orgNum*100))/100);

Output:

Level #0:
Variable _level0.$version = "WIN 6,0,21,0"
Variable _level0.orgNum = 46.568989
Variable _level0.newNum = 46.57

orgNum=46.5689890;
newNum=((Math.round(orgNum*100))/100);

Output:

Level #0:
Variable _level0.$version = "WIN 6,0,21,0"
Variable _level0.orgNum = 46.568989
Variable _level0.newNum = 46.57

how can I keep it to round at least 2 decimal points to include the '.00'?

It currently rounds 6.10 to 6.1, and I'm trying to work with currency.

Any ideas much appreciated.










privacy (GDPR)