Rounding methods
Rounding methods are used by SET_NUMBER actions to control how the final value is rounded before it is written into the target field.
| 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" engine="twig.2">
<![CDATA[{{ targetItem.fields.WIDTH_MM.value.data * 1.20 }}]]>
</Template>
</Action>1
2
3
4
5
2
3
4
5