Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

round to nearest decimal javascript

function round(value, precision) {
    var multiplier = Math.pow(10, precision || 0);
    return Math.round(value * multiplier) / multiplier;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nearest #decimal #javascript
ADD COMMENT
Topic
Name
7+9 =