Skip to main content
Participating Frequently
September 20, 2007
Question

round input number to 2 place

  • September 20, 2007
  • 1 reply
  • 402 views
I have a score of numbers that total up percent, but get like 25.22222222%. These are input numbers so don't know value until until put in.
How do I set it to only pull up 2 decimal places?

thks
This topic has been closed for replies.

1 reply

Inspiring
September 20, 2007
Hi --

The easiest way is to multiply by 100, use the Math.parseInt() function and
then divide the remaining number by 100. This would turn 25.2222222 into
2522.222222, then the parseInt function will get you 2522 and then you
divide by 100 and get 25.22.

Rich


"maureen27" <webforumsuser@macromedia.com> wrote in message
news:fcsk16$1rg$1@forums.macromedia.com...
>I have a score of numbers that total up percent, but get like 25.22222222%.
>These are input numbers so don't know value until until put in.
> How do I set it to only pull up 2 decimal places?
>
> thks


Participating Frequently
September 20, 2007
I tried attached.

Now I don't get an answer at all.

Can you help me word it?
Participating Frequently
September 20, 2007
Need help with this please