Action > SET_NUMBER β
See details here: NUMBER actions.
Value details β
| XPath | Description | Occurrence |
|---|---|---|
| Action@type | SET_NUMBER | 1 |
| Action/Value | Value to apply | 0..1 |
| Action/Value/@suffix | Suffixe to apply to the value | 0..1 |
Formula vs Mapping
- Within a mapping rule, you can set a suffix value to the number using the
suffixparameter. If the provided suffix does not exist, the rule is not imported. - Within a formula rule, you cannot set a suffix value.
| Source value | Destination = NUMBER field |
|---|---|
10 | 10 |
10.1 | 10.1 |
-10 | -10 |
1,000.01 | unchanged value The proposed value is invalid, hence no value is persisted. |
`` or null | null (absence of value) Existing value is removed |
Copy details β
| XPath | Description | Occurrence |
|---|---|---|
| Action@type | SET_NUMBER | 1 |
| Action/Copy | Valeur to apply | 0..1 |
| Action/Copy/@source | Source field key | 1 |
| Action/Copy/@precision | Precision to apply to applied value | 0..1 |
| Action/Copy/@round | Enum : UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN. Voir https://docs.oracle.com/javase/8/docs/api/java/math/RoundingMode.html | 0..1 |
| Action/Copy/@suffix | Suffixe to apply to the value | 0..1 |
If one of these attributes is not filled in or is invalid, the formula is considered invalid and the FORMULA_WRONG_FORMAT log is added to the execution report.
Formula vs Mapping
- Within a mapping rule, you can set a suffix value to the number using the
suffixparameter. If the provided suffix does not exist, the rule is not imported. - Within a formula rule, you cannot set a suffix value.
| Source value | Destination = NUMBER field |
|---|---|
10, precision = 1, round = UP | 1 |
10.1, precision = 1, round = UP | 10.1 |
-10, precision = 1, round = UP | 10 |
1000.01, precision = 1, round = UP | 1000.1 |
`` or null | null (absence of value) Existing value is removed |
Template details β
precision and round attributes are mandatory.
| XPath | Description | Occurrence |
|---|---|---|
| Action@type | SET_NUMBER | 1 |
| Action/Template | Template to apply | 0..1 |
| Action/Template/@precision | Precision to apply to applied value | 0..1 |
| Action/Template/@round | Enum : UP, DOWN, CEILING, FLOOR, HALF_UP, HALF_DOWN. Voir https://docs.oracle.com/javase/8/docs/api/java/math/RoundingMode.html | 0..1 |
Formula vs Mapping
- Within a mapping rule, you can set a suffix value to the number using the
suffixparameter. If the provided suffix does not exist, the rule is not imported. - Within a formula rule, you cannot set a suffix value.
| Template result | Destination = NUMBER field |
|---|---|
10 | 10 |
10.1 | 10.1 |
-10 | -10 |
1,000.01 | unchanged value The proposed value is invalid, hence no value is persisted. |
`` or null | null (absence of value) Existing value is removed |
Rounding behavior β
With precision equal to 0.
| Input Number | UP | DOWN | CEILING | FLOOR | HALF_UP | HALF_DOWN |
|---|---|---|---|---|---|---|
| 5.5 | 6 | 5 | 6 | 5 | 5 | 6 |
| 2.5 | 3 | 2 | 3 | 2 | 2 | 2 |
| 1.6 | 2 | 1 | 2 | 1 | 2 | 2 |
| 1.1 | 2 | 1 | 2 | 1 | 1 | 2 |
| 1.0 | 1 | 1 | 1 | 1 | 1 | 1 |
| -1.0 | -1 | -1 | -1 | -1 | -1 | 1 |
| -1.1 | -2 | -1 | -1 | -2 | -1 | -1 |
| -1.6 | -2 | -1 | -1 | -2 | -2 | -1 |
| -2.5 | -3 | -2 | -2 | -3 | -2 | -2 |
| -5.5 | -6 | -5 | -5 | -6 | -6 | -6 |
Suffix β
Archived suffixes can be set in the SET_NUMBER action.