Details
-
Type:
Improvement
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0
-
Component/s: None
-
Labels:None
-
Number of attachments :
Description
The float data type should never be used for precise values, such as currency. For that, you will need to use the java.math.BigDecimal class instead.
Now fi when the decimal value 9999.9999 is persisted, the retrieved value will be 10000.0.
This is not precise enough for systems that work with currencies.
===================
Eric Jan Malotaux [17/feb/09 11:29 AM] This is probably not a good reason to implement decimal with BigDecimal. Money should be modelled as a value type, with an integer for the value property, and an indicator for the precision. For example, whether the value mean whole currency values, e.g. euro's or dollars, or cents, or another position for the virtual decimal position. And a currency indicator, of course.
Activity
Eric Jan Malotaux
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | Wish List [ 15007 ] | |
| Fix Version/s | 1.1.0-beta-1 [ 15006 ] |
Johan Vogelzang
made changes -
| Assignee | Johan Vogelzang [ jvogelzang ] |
Johan Vogelzang
made changes -
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 2.0 [ 16205 ] | |
| Fix Version/s | Wish List [ 15007 ] | |
| Resolution | Fixed [ 1 ] |