In java am trying to find an efficient way to round a BigDecimal to two decimals, Up or Down based on a condition.
IF condition true then: 12.390 --->
I suggest the following (standing on the shoulders of giants...):
public BigDecimal roundNumber(final BigDecimal number, final boolean isFloor){ return number.setScale(2, isFloor ? RoundingMode.FLOOR : RoundingMode.CEILING); }