You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Johan Compagner (JIRA)" <ji...@apache.org> on 2008/03/07 22:59:46 UTC
[jira] Closed: (WICKET-1395) BigDecimalConverter does not work with
space - eg, French or Russian Locales.
[ https://issues.apache.org/jira/browse/WICKET-1395?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Johan Compagner closed WICKET-1395.
-----------------------------------
Resolution: Fixed
Fix Version/s: 1.3.2
fixed it by doing the same stuff as the double converter
> BigDecimalConverter does not work with space - eg, French or Russian Locales.
> -----------------------------------------------------------------------------
>
> Key: WICKET-1395
> URL: https://issues.apache.org/jira/browse/WICKET-1395
> Project: Wicket
> Issue Type: Bug
> Components: wicket
> Affects Versions: 1.3.1
> Reporter: Ned Collyer
> Assignee: Johan Compagner
> Fix For: 1.3.2
>
>
> 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.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.