i get a NumberFormatException : invalid double \"111,000,000\" in this line of code :
double SalePotential = Double.valueOf(EtPotential.getText().toString());
<
Use replace function to replace all occurences of ,
String s= EtPotential.getText().toString();
s = s.replace(",", "");
try
{
double SalePotential = Double.parseDouble(s);
}catch(NumberFormatException e)
{
e.printStackTrace();
}
Remove "," before parsing
double SalePotential = Double.parseDouble(EtPotential.getText().toString().replace(",", ""));
Update : With proper implementation
double salePotential = 0; // Variable name should start with small letter
try {
salePotential = Double.parseDouble(EtPotential.getText().toString().replace(",", ""));
} catch (NumberFormatException e) {
// EditText EtPotential does not contain a valid double
}
Happy coding :)