Javascript convert int to float

I have a variable

var fval = 4; 

now i want to put as 4.00

+46
javascript
Oct 30 '10 at 6:10
source share
1 answer

JavaScript is only of type Number, which stores floating point values.

No int.

Edit:

If you want to format the number as a string with two digits after using the decimal point:

 (4).toFixed(2) 
+76
Oct 30 '10 at 6:12
source share
— -



All Articles