Search code examples
javafinance

How can I convince my boss to use BigDecimal


Now we have an existing Java application dealing with finance issues. But it was implemented several years ago using "double" type instead of "BigDecimal". I can show the difference between those two types, but for the samples we got, those small errors caused by "double" may not lead to a different result when we use "BigDecimal". So how can I convince my boss that it worth spending some time on rewriting this application? Or is there a law or something official that states it is kind of standard to use BigDecial in financial industry? Thnaks.


Solution

  • The conversion to BigDecimal is done in a fixed time, possibly incremental when you have a really large code base or you want to migrate/test per module.

    Accountancy may well have a stand: either pro, or contra ("I can keep an account of cent differences").

    Data errors caused by double will happen irregularly and at least do not present the firm well to the outside. Bills for 0.01 cents is just one thing.

    Repairs will cost more time and cannot as well be affirmed (places of rounding might not all be found at the correct spot).

    Package deals: If your country uses a decimal comma, the software the decimal point, do all together. The same for right alignment of numbers, thousand separators.