• support@answerspoint.com

converting integer to float with precision 2 using Javascript or Jquery

291

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 9 months ago
  • Community  wiki

Your Answer

    Facebook Share