0 works

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


dashboard

Posted by @bravocoder #python

>>> a = "545.2222"
>>> float(a)
545.22220000000004
>>> int(float(a))
545
content_copy
https://stackoverflow.com/questions/379906/how-do-i-parse-a-string-to-a-float-or-int-in-python

>> Browse more code snippets

more_vert