converting integer to float with precision 2 using Javascript or Jquery
I want to convert the integer to floating number with precision 2. ie. -
18 => 18.00
65 => 65.00
Please help me.
Thank you.
Javascript
jQuery
- asked 6 years ago
- G John
1Answer
If you want to convert the integer to floating number
Use .toFixed() function
var num = 445;
num.toFixed(2); //"445.00"
- answered 6 years ago
- Community wiki
Your Answer