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 ---> 12.39
12.391 ---> 12.40
12.395 ---> 12.40
12.399 ---> 12.40
If condition false then:
12.390 ---> 12.39
12.391 ---> 12.39
12.395 ---> 12.39
12.399 ---> 12.39
What is the most efficient way to accomplish this?