Skip to content

Instantly share code, notes, and snippets.

@tomraithel
Created September 29, 2012 11:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tomraithel/3803731 to your computer and use it in GitHub Desktop.
Save tomraithel/3803731 to your computer and use it in GitHub Desktop.
RUBY: Round number and strip trailing zeros
"%g" % ("%0.2f" % 16.4555)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment