Rules engine – Rounding methods
Rounding methods are used by number actions such as:
SET_NUMBERwith<Copy ... round="..." />SET_NUMBERwith<Template ... round="..." />
See also:
Rounding methods
| Input number | UP | DOWN | CEILING | FLOOR | HALF_UP | HALF_DOWN |
|---|---|---|---|---|---|---|
| 5.5 | 6 | 5 | 6 | 5 | 6 | 5 |
| 2.5 | 3 | 2 | 3 | 2 | 3 | 2 |
| 1.6 | 2 | 1 | 2 | 1 | 2 | 2 |
| 1.1 | 2 | 1 | 2 | 1 | 1 | 1 |
| 1.0 | 1 | 1 | 1 | 1 | 1 | 1 |
| -1.0 | -2 | -1 | -1 | -1 | -1 | -1 |
| -1.1 | -2 | -1 | -1 | -2 | -1 | -1 |
| -1.6 | -2 | -1 | -1 | -2 | -2 | -2 |
| -2.5 | -3 | -2 | -2 | -3 | -2 | -3 |
| -5.5 | -6 | -5 | -5 | -6 | -5 | -6 |
Examples
xml
<Action type="SET_NUMBER">
<Copy source="WIDTH" precision="2" round="HALF_UP" />
</Action>1
2
3
2
3
xml
<Action type="SET_NUMBER">
<Template precision="0" round="CEILING"><![CDATA[{{source("WIDTH_MM")}} / 10]]></Template>
</Action>1
2
3
2
3