If it's a financial value, you should pretty much always use BigDecimal
- or use an integer with an implicit scaling value (e.g. store cents instead of dollars).
Floating binary point (float
, double
) is almost never appropriate for financial applications, as the values usually have precise decimal values which aren't exactly representable in floating binary point.
That doesn't mean double
is a useless data type - it's fine for natural, continuous values such as distances. It's just not good for "artificial" discrete values which are typically measured specified in decimal.