Skip to content

Instantly share code, notes, and snippets.

@1024jp
Created December 30, 2015 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1024jp/f007aae78c2e55f9106c to your computer and use it in GitHub Desktop.
Save 1024jp/f007aae78c2e55f9106c to your computer and use it in GitHub Desktop.
round to the nearest 0.5
double swedishRound(double number) { return round(2.0 * number) / 2.0; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment