When using the following NumberFormat:
NumberFormat amountFormat = NumberFormat
.getNumberInstance(I18N.getThreadLocale());
amountFormat.setMaximumFractionDigits(2);
amountFormat.setMinimumFractionDigits(2);
I get the following results when parsing via
System.out.println(amountFormat.parse(value));
- 10,50 => 1050
- 10,5 => 105
- 0,25 => 25
I know that in Locale.ENGLISH the "," is the group separator. But I don't think that the above results make sense. And our customers get weird about this formatting.
How can I disable this grouping?
I would like to have the following results:
- 10,50 => ParseException
- 10,5 => ParseException
- 0,25 => ParseException
Is there a standard way to do this? Or do I have to program my own NumberFormat?