Created
July 22, 2014 11:32
-
-
Save alorma/760aab10770fd1957598 to your computer and use it in GitHub Desktop.
Round any number to their nearest 5 step.
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
protected int roundUp(int n) { | |
return (n + 4) / 5 * 5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment