I have a variable
var fval = 4;
now I want out put as 4.00
JavaScript only has a Number type that stores floating point values.
There is no int.
Edit:
If you want to format the number as a string with two digits after the decimal point use:
(4).toFixed(2)
1.4m articles
1.4m replys
5 comments
57.0k users