Description
Space character is not getting correctly translated when converting to BigDecimal.
The following occurs with a bound BigDecimal field
Input: 3000
Submit
Output: 3 000
Input: 3 000
Submit
Output: 3
The following code highlights the problem.
BigDecimalConverter bdc = new BigDecimalConverter();
System.out.println(bdc.convertToObject("3 000", Locale.FRENCH));
=>3
DoubleConverter dc = new DoubleConverter();
System.out.println(dc.convertToObject("3 000", Locale.FRENCH));
=>3000.0
I think I found the problem.
BigDecimalConverter#convertToObject is calling getNumberFormat(locale), but it should be calling AbstractNumberConverter#parse like DoubleConverter does (or something similar).
It looks like code to handle the different "thousand" separators has been added there.
Also of note, it does not appear that the BigDecimalConverter is covered by the Converters test.
See thread http://www.nabble.com/BigDecimal-converter---broken-for-French-Russian-%21--ts15820747.html for more context.