Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Javascript
rounding up a number so that it is divisible by 5 javascript
user3754696
Programming language:
Javascript
2021-07-29 18:58:02
0
Q:
rounding up a number so that it is divisible by 5 javascript
Haley Larez
Code:
Javascript
2021-05-28 04:01:26
function round5(x) { return Math.ceil(x/5)*5; }
1
Rand al'Thor
Code:
Javascript
2021-02-11 18:28:45
const roundToNearest5 = x => Math.round(x/5)*5
0
Tags
number
java
javascript
div
visible
Related
sum all numbers in a range javascript
javascript round to 2 decimals
round number 2 decimals javascript
rounding off numbers javascript
javascript round to 2 digits
javascript round to nearest 10
euler 3 and 5 javascript
javascript round decimal 2 digits
javascript round to 2 decimal places
javascript round to 7 decimal places
exponent of two numbers in javascript
round a number to higher integer javascript
two sum javascript
javascript sum of all the multiples of 3 or 5 below 1000 running total
find next greater number with same set of digits javascript
Sum of all the multiples of 3 or 5
javascript round 2 decimals
rounding number to x decimals javascript
New to Communities?
Join the community