Package ch.tocco.nice2.toolbox.api.math
Class MathUtils
java.lang.Object
ch.tocco.nice2.toolbox.api.math.MathUtils
Static class providing utility methods for maths tasks
- 
Method SummaryModifier and TypeMethodDescriptionstatic BigDecimalround(BigDecimal value, BigDecimal rounding) round a decimalvalueto a multiple ofrounding.
 Examples: value: 4.3, rounding: 0.25, result: 4.25 value: 4.3, rounding: 0.5, result: 4.5
- 
Method Details- 
roundround a decimalvalueto a multiple ofrounding.
 - Examples:
- value: 4.3, rounding: 0.25, result: 4.25
- value: 4.3, rounding: 0.5, result: 4.5
 - Parameters:
- value- a value to round
- rounding- a decimal number to round to. Possible values are all elements of {1 / n | n ∈ {1, 2, 3, ...}} ∪ {1, 2, 3, ...}
- Returns:
- the rounded value
 
 
-