My API handles balances and other financial amounts from a database and external sources. The decimal precision is known, and integer arithmetic looks easier to maintain than using BigDecimal throughout.
Would it make sense to convert incoming amounts to integer minor units, calculate with those, and convert back for responses?
t0.clk:
That conversion assumes two decimal places. The scale needs to come from the currency or whatever precision the amount represents.