Round up Javascript decimals

Asked

Viewed 78 times

2

When calculating 5,605.50 * 0.08 (8%) the result is 448.40000000000003

I need to round off that 448.40000000000003 for 448.44 which is the exact 8% value on the calculator...

if I use the .toFixed(2) he gets 448.40...

if I use the parseFloat(valor).toFixed(2) he gets 448.4

  • 2

    Here for me this calculation is already working right from the start, follow my test here.

  • 1

    Transform the number with point that the result will be correct: 5605.50 * 0.08 --> 448.44

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.