0 works

How to Parse a numeric string into a float or integer in Python


dashboard+ Project

Posted by @bravocoder #python

Code snippet:

>>> a = "545.2222"
>>> float(a)
545.22220000000004
>>> int(float(a))
545
content_copyCopy to Clipboard

Code snippet source:

https://stackoverflow.com/questions/379906/how-do-i-parse-a-string-to-a-float-or-int-in-python

>> Browse more code snippets

more_vert