• support@answerspoint.com

converting integer to float with precision 2 using Javascript or Jquery

2762

I want to convert the integer to floating number with precision 2. ie. -

18 => 18.00

65 => 65.00

Please help me.

Thank you.

1Answer


0

If you want to convert the integer to floating number

Use .toFixed() function

var num = 445;
num.toFixed(2); //"445.00"

 

  • answered 5 years ago
  • Community  wiki

Your Answer

    Facebook Share        
       
  • asked 5 years ago
  • viewed 2762 times
  • active 5 years ago

Best Rated Questions