Same. Most financial applications use fixed precision decimals. BigDecimal is their natural representation in java; the other existing java types (double, long, etc) do not model them well.
From my experience other than UI most use long or multiple longs. At least fintech does.
However I don’t have experience with traditional banking and most of my experience is simple billing.
I vaguely remember reading comment that u/rzwitserloot had similar experience and fair bit more on financial coding experience than myself and indicated folks use longs.
You're right. The common workaround is to express such fixed precision data in their smallest unit, for eg, in cents instead of dollars. For other units, it's not so clear (eg units of weight).
You can also model fixed decimals using a long (unscaled value) and a byte (for where the decimal point goes). Like a lightweight, but fixed-range, BD. But, ofc, this would be clumsy in json.
View all comments
Show parent comment
3
u/agentoutlier Jul 23 '26
From my experience other than UI most use long or multiple longs. At least fintech does.
However I don’t have experience with traditional banking and most of my experience is simple billing.
I vaguely remember reading comment that u/rzwitserloot had similar experience and fair bit more on financial coding experience than myself and indicated folks use longs.