Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

round up to nearest 0.5 javascript

// Simplest way
function roundHalf(num) {
    return Math.round(num*2)/2;
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #nearest #javascript
ADD COMMENT
Topic
Name
5+5 =