5 Replies
is there any way to add .00 for the number with no . and add a extera .0 to number have 1.0 ?
MDN Web Docs
Number.prototype.toFixed() - JavaScript | MDN
The toFixed() method of Number values returns a string representing this number using fixed-point notation with the specified number of decimal places.
Do note that
Number.toFixed()
changes it from a number to a stringtnx alot
JavaScript numbers are all 64-bit floats so
1
is the exact same thing as 1.00
. When there is nothing after the decimal JS truncates it, assuming you wanted an integer