BigDecimal and Groovy

with No Comments

Note that make me more crazy:

assert 634.78 == new BigDecimal(634.785).setScale(2, RoundingMode.HALF_UP)

assert 634.79 == new BigDecimal("${634.785}").setScale(2, RoundingMode.HALF_UP)

Why these things can’t be just strict?

:)

Leave a Reply