I have an EditText-window which when I type a double number for example 0,01 displays 001), it will not take the period (comma) sign (oper2 representing operand2). What is strange is that the EditText window over it (oper1 representing operand2) takes period. As far as I can see it has exactly the same code. Can anyone tell me what is wrong? Here is the relevant java code:
if ((operand1.getText().length() > 0) && (operand2.getText().length() > 0)) {
double oper1 = Double.parseDouble(operand1.getText().toString());
double oper2 = Double.parseDouble(operand2.getText().toString());
double theResult = ((oper2 * oper1 * 60) / 40);
String stringResult = String.format("%.2f", theResult);
mlHour.setText(stringResult + " ml/t");
} else {
Toast.makeText(AdrenalinActivity.this, getString(R.string.toastNoradrenalin), Toast.LENGTH_LONG).show();
}
}
});