Skip to content

Instantly share code, notes, and snippets.

@fiorix
Created December 4, 2015 19:20
Show Gist options
  • Save fiorix/e9849357f565ca092ee8 to your computer and use it in GitHub Desktop.
Save fiorix/e9849357f565ca092ee8 to your computer and use it in GitHub Desktop.

Revisions

  1. fiorix created this gist Dec 4, 2015.
    7 changes: 7 additions & 0 deletions round-int
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    func RoundUp(v int) int {
    return 10 * ((v + 9) / 10)
    }

    func RoundDown(v int) int {
    return 10 * (v / 10)
    }