atof problem.

Jeff Blaine jblaine at kickflop.ne.mediaone.net
Thu Jul 13 21:37:23 EDT 2000


>I am having a problem with the atof function. I tried to convert 1,142.00 to
>a float but the comma causes a problem. I resolved the problem by removing
>the comma but there must be a better way.

I'm pretty sure you did it the Right Way.

Numbers containing commas are there for readability purposes by humans.

It's just a call to string.replace() to get rid of the comma... (or several
other ways to do the same thing).



More information about the Python-list mailing list