Skip to content

Instantly share code, notes, and snippets.

Created January 29, 2013 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 anonymous/4666002 to your computer and use it in GitHub Desktop.
Save anonymous/4666002 to your computer and use it in GitHub Desktop.
PSEUDOCODE HERE.
Let's say
A / B = C
I want to round C to two decimal places
Let's say
In real life:
A/B = 0.135
ROUND(A/B, 2) = 0.14
FPP:
A/B = 0.1349999999
ROUND(A/B, 2) = 0.13 // error
ROUND(ROUND(A/B, 3), 2) = 0.13 // OK, but how can I know to round to 3 decimal places first?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment