[
https://issues.apache.org/jira/browse/WICKET-1344?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Johan Compagner updated WICKET-1344:
------------------------------------
Fix Version/s: 1.4-M1
Assignee: Johan Compagner
We can only do this for Wicket 1.4 because the method we need to call is java 5
> BigDecimalConverter is not precise
> ----------------------------------
>
> Key: WICKET-1344
> URL: https://issues.apache.org/jira/browse/WICKET-1344
> Project: Wicket
> Issue Type: Improvement
> Components: wicket
> Affects Versions: 1.3.1
> Reporter: Andri Saar
> Assignee: Johan Compagner
> Priority: Minor
> Fix For: 1.4-M1
>
> Attachments: BigDecimalConverter.patch
>
>
> Currently, if we use the BigDecimalConverter class, it converts the values by
> first letting the NumberFormat to parse the value into a Double, which the
> BigDecimalConverter class in turn turns into a BigDecimal.
> Unfortunately such an implementation loses precision, for example if we enter
> "123.45" in a form, it can be converted to "123.45000000000001" or
> "123.44999999999999999" thanks to the conversion to a Double.
> Fixing the issue is rather simple: check if the NumberFormat you get is a
> DecimalFormat, and if yes, simply call format.setParseBigDecimal(true) and
> the NumberFormat will interpret the values correctly.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.