0

I've been doing some calculation using CEL. Because of the complication of the calculation, the result ends up with some long decimal points. I'm just wondering is there any function that I can transform the data like 23.012372983659365034701 to 23.01?

Thank you.

1 Answers1

1

In CEL the numbers are Java BigDecimal (unless you create it as some other data type). The getNumber() method for example returns BigDecimal.

You can use the setScale function of BigDecimal (see https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html#setScale(int,%20java.math.RoundingMode))

TyrManuZ
  • 2,039
  • 1
  • 14
  • 23