Created
April 7, 2024 10:07
-
-
Save ludndev/c48811164b93f1d122b1fc9e1e9b73f8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function roundUpToAny(n, up = 5) { | |
return Math.round((n + (up / 2)) / up) * up; | |
} | |
console.log(roundUpToAny(1881)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment