Skip to content

Instantly share code, notes, and snippets.

@kevinw
Created March 2, 2011 17:35
Show Gist options
  • Save kevinw/851332 to your computer and use it in GitHub Desktop.
Save kevinw/851332 to your computer and use it in GitHub Desktop.
>>> '%d' % 2.0
'2'
>>> '{0:d}'.format(2.0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'd' for object of type 'float'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment