Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Round off a number to the next multiple of 5 using JavaScript

<script>
    function round(x) {
        return Math.ceil(x / 5) * 5;
    }
  
var n = 34;
console.log(round(n)); 
</script>
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Round #number #multiple #JavaScript
ADD COMMENT
Topic
Name
5+5 =