BigDecimalTextField looses precision when value is set
------------------------------------------------------
Key: RCP-539
URL: http://jira.springframework.org/browse/RCP-539
Project: Spring Framework Rich Client Project
Issue Type: Bug
Components: Binding System
Affects Versions: 0.2.1
Reporter: Johannes Bergmann
Method setValue in BigDecimalTextField converts the number to a double value before passing it to the format:
public void setValue(Number number) {
String txt = null;
if (number != null) {
txt = this.format.format(number.doubleValue());
}
setText(txt);
}
If number is a BigDecimal the precision of this value might be lost.
Example: new BigDecimal("1234567890123456.7") is displayed as 1234567890123456.7
Supposed solution:
Pass number instance directly to the format method:
txt = this.format.format(number);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.springframework.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
|