I have a question regarding toFixed() function. If I have a float e.g. – 3.123123423 and 0. How can I output it to input box with toFixed(2) so the inputbox values would be 3.12 and 0. I mean if the value is integer I want output it without trailing .00 🙂
Share
As there is no difference between integers and floats in JavaScript, here is my quick’n’dirty approach:
Or something generic: