How can I parse a float scanned from a sheet as text, containing commas?
txt = "1,903.44"
value = float(txt) # This fails due to ',' in string
UPDATE: Sorry I wasn’t clear. I’m using jython 2.5, which doesn’t have the locale module.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you need localization, this won’t really work but it does the trick if you know that commas are your separators.