type OperationContext = {| precision?: Number, roundingMode?: RoundingMode |}
Math Types (dw::util::Math)
Type | Definition | Description |
---|---|---|
OperationContext |
Defines the configuration under which a math operation is executed.
|
|
RoundCeiling |
|
Rounding mode that rounds toward positive infinity. If the number is positive, it behaves like |
RoundDown |
|
Rounding mode that rounds toward zero. It never increments the digit before a discarded fraction (for example, truncates). |
RoundFloor |
|
Rounding mode that rounds toward negative infinity. If the number is positive, it behaves like |
RoundHalfDown |
|
Rounding mode that rounds toward the nearest neighbor, unless both neighbors are equidistant, in which case it rounds down.
If the discarded fraction is greater than 0.5, it behaves like |
RoundHalfEven |
|
Rounding mode that rounds toward the nearest neighbor, unless both neighbors are equidistant, in which case it rounds toward the even neighbor.
If the digit to the left of the discarded fraction is odd, it behaves like |
RoundHalfUp |
|
Rounding mode that rounds toward the nearest neighbor, unless both neighbors are equidistant, in which case it rounds up.
If the discarded fraction is greater than or equal to 0.5, it behaves like |
RoundUnnecessary |
|
Rounding mode that asserts that the requested operation has an exact result, so rounding isn’t necessary. |
RoundUp |
|
Rounding mode that rounds away from zero. It always increments the digit before a nonzero discarded fraction. |
RoundingMode |
|
Enumeration of rounding strategies available for math operations. Available options are: |