I’m getting NumberFormatException when I try to parse 265,858 with Integer.parseInt().
Is there any way to parse it into an integer?
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.
Is this comma a decimal separator or are these two numbers? In the first case you must provide
LocaletoNumberFormatclass that uses comma as decimal separator:This results in
265.858. But using US locale you’ll get265858:That’s because in France they treat comma as decimal separator while in US – as grouping (thousand) separator.
If these are two numbers –
String.split()them and parse two separate strings independently.