accounting-pattern
accounting-pattern copied to clipboard
Comparing `BigDecimal`s with different scales
This causes failure:
AcceptanceTest.test:25 expected: <600> but was: <600.00>
in
https://github.com/grahambrooks/accounting-pattern/blob/da5d7f4a642ed1686fb40781db8c984080bb6baf/src/test/java/accounting/patterns/AcceptanceTest.java#L25
and later
https://github.com/grahambrooks/accounting-pattern/blob/da5d7f4a642ed1686fb40781db8c984080bb6baf/src/test/java/accounting/patterns/AcceptanceTest.java#L29
and then
https://github.com/grahambrooks/accounting-pattern/blob/da5d7f4a642ed1686fb40781db8c984080bb6baf/src/test/java/accounting/patterns/AcceptanceTest.java#L32
This is 7.4 Mistake 58: Comparing BigDecimals with different scales in 100 Java Mistakes and How to Avoid Them.