Package cdm.base.math.functions
Class RoundToPrecisionRemoveTrailingZeros
java.lang.Object
cdm.base.math.functions.RoundToPrecisionRemoveTrailingZeros
- All Implemented Interfaces:
com.rosetta.model.lib.functions.RosettaFunction
- Direct Known Subclasses:
RoundToPrecisionRemoveTrailingZeros.RoundToPrecisionRemoveTrailingZerosDefault,RoundToPrecisionRemoveTrailingZerosImpl
public abstract class RoundToPrecisionRemoveTrailingZeros
extends Object
implements com.rosetta.model.lib.functions.RosettaFunction
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.rosetta.model.lib.functions.ConditionValidator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BigDecimaldoEvaluate(BigDecimal value, Integer precision, RoundingDirectionEnum roundingMode) evaluate(BigDecimal value, Integer precision, RoundingDirectionEnum roundingMode) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.rosetta.model.lib.functions.RosettaFunction
toBuilder, toBuilder, toBuilder
-
Field Details
-
conditionValidator
@Inject protected com.rosetta.model.lib.functions.ConditionValidator conditionValidator
-
-
Constructor Details
-
RoundToPrecisionRemoveTrailingZeros
public RoundToPrecisionRemoveTrailingZeros()
-
-
Method Details
-
evaluate
- Parameters:
value- The original (unrounded) number.precision- The number of decimal digits of precision.roundingMode- The method of rounding (up/down/nearest).- Returns:
- roundedValue The value to the desired precision
-
doEvaluate
protected abstract BigDecimal doEvaluate(BigDecimal value, Integer precision, RoundingDirectionEnum roundingMode)
-