Skip to content

Instantly share code, notes, and snippets.

@1024jp
Created December 30, 2015 17:30
Show Gist options
  • Select an option

  • Save 1024jp/f007aae78c2e55f9106c to your computer and use it in GitHub Desktop.

Select an option

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