Skip to content

Instantly share code, notes, and snippets.

@alorma
Created July 22, 2014 11:32
Show Gist options
  • Save alorma/760aab10770fd1957598 to your computer and use it in GitHub Desktop.
Save alorma/760aab10770fd1957598 to your computer and use it in GitHub Desktop.
Round any number to their nearest 5 step.
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