Created
May 6, 2015 19:37
-
-
Save c0ldlimit/1ed013ea85bfdfa55669 to your computer and use it in GitHub Desktop.
#python formatting floats in python without superfluous zeros
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#http://stackoverflow.com/questions/2440692/formatting-floats-in-python-without-superfluous-zeros | |
#https://docs.python.org/2/library/string.html#format-specification-mini-language | |
'{0:g}'.format(3.140) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment