How To Convert 0 As Number

How To Convert 0 to 0.00 As Number?

Table of Contents

 there is no way for that in JavaScript. Formatting a Number always returns a String. For this you have some possibilities, though
Number(1).toFixed(2) // "1.00" - setting the number of digits after the decimal point 
Number(1).toPrecision(2) // "1.0" - setting the number of digits

 

Leave a Comment

Your email address will not be published. Required fields are marked *

No data found.