/
How to Round Numeric Value
How to Round Numeric Value
Since the numerical elements are of a type java.math.BigDecimal, you can use setScale function for rounding:
resultPrice.setScale(2, 4) // 4 = ROUND_HALF_UP
For details see: http://docs.oracle.com/javase/8/docs/api/java/math/BigDecimal.html#setScale-int-int-
Related content
How to Set the Number of Displayed Decimals in User Input
How to Set the Number of Displayed Decimals in User Input
More like this
Recommended Operators
Recommended Operators
Read with this
Calling Library Functions with Aliases
Calling Library Functions with Aliases
More like this
Type Codes
Type Codes
Read with this
Groovy Programming Language
Groovy Programming Language
Read with this
Library Logic
Library Logic
Read with this
Found an issue in documentation? Write to us.