Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js number with four decimal places

var myNumber = 2;

myNumber.toFixed(2); //returns "2.00"
myNumber.toFixed(1); //returns "2.0"
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #js #number #decimal #places
ADD COMMENT
Topic
Name
1+2 =