Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to round numbers in javscript

//You can do this instead of using math.round! It is easier to understand using this function!

var x = 5.0364342423;
console.log(x.toFixed(2));
//result should be 5.04
Source by pawelgrzybek.com #
 
PREVIOUS NEXT
Tagged: #numbers #javscript
ADD COMMENT
Topic
Name
7+9 =