This set of Ruleset Actions deals with numeric data types, such as integers, floating-point numbers, and more.
Video: See the Cleo Community Videos on conditioning a rule using Numeric Actions and an example of using Actions to aggregate data for populate message data.
Absolute
Absolute determines the absolute value of a number (Factor1) and optionally allows for specifying RoundingDecimalPositions. In plain terms, it strips the sign from a number, always returning a non-negative result.
Typical use cases:
1. Financial amounts - credit/debit normalization Inbound EDI documents (like an 810 invoice) sometimes carry line item amounts as negative numbers to indicate credits or adjustments. Before passing a value downstream, you can use Absolute to ensure the amount is always positive, then handle the debit/credit logic separately via a flag or segment qualifier.
| Factor1 | Result |
|---|---|
-149.50 |
149.50 |
149.50 |
149.50 |
2. Quantity differences - variance calculations When comparing an ordered quantity against a shipped quantity, the difference could be positive or negative depending on over/under-shipment. Absolute lets you work with the magnitude of the difference regardless of direction — useful for tolerance checks like "flag any variance greater than 10 units."
| Factor1 (ordered - shipped) | Result |
|---|---|
-7 |
7 |
7 |
7 |
3. Rounding combined with absolute value The RoundingDecimalPositions property rounds the result "Half Up" when it is not null and >= 0 — for example, rounding 0.745 to 0.75. This makes Absolute useful when you need a clean, sign-free number with a specific decimal precision for output to a target system that doesn't accept extra decimal places or negative values.
| Factor1 | RoundingDecimalPositions | Result |
|---|---|---|
-0.745 |
2 |
0.75 |
-1234.5678 |
2 |
1234.57 |
In short, Absolute is most commonly reached for when source data may contain signed numbers but the target system or business logic requires a positive value, often paired with rounding to meet a trading partner's formatting requirements.
Add
Adds a number (Addend1) to another number (Addend2); allows for specifying Rounding Decimal Positions.
CreateNumberFromStringWithLocale
Converts a string value (Source Value) formatted by a language tag (Source Locale) to a numeric value.
Example: A Source Value of "123.45“ and a Source Locale of "nl-NL" (Netherlands) returns 12345
CreateStringFromNumberWithLocale
Converts a numeric value (Source Value) formatted by a language tag (Target Locale) to a string value.
Example: A Source Value of 123.45 and a Target Locale of "nl-NL" (Netherlands) returns "123,45“
DivideRoundDown
Divides a number (Dividend) by another number (Divisor); allows for specifying Rounding Decimal Positions.
DivideRoundHalfUp
Divides a number (Dividend) by another number (Divisor); allows for specifying Rounding Decimal Positions.
Exponentiate
Raises the value of a number (Factor1) by the value of another number (Exponent).
GreaterThan
Determines if a number (numberA) is greater than another number (numberB) and returns a Boolean value.
GreaterThanOrEquals
Determines if a number (numberA) is greater than or equal to another number (numberB) and returns a Boolean value.
LessThan
Determines if a number (numberA) is less than another number (numberB) and returns a Boolean value
LessThanOrEquals.
Max
Determines the maximum value of two numbers (Number1 and Number2).
Min
Determines the minimum value of two numbers (Number1 and Number2).
Multiply
Multiplies two numbers (Factor1 and Factor2); allows for specifying Rounding Decimal Positions.
Negate
Returns the negated value of a number (Factor1); allows for specifying Rounding Decimal Positions.
NumberEquals
Determines if two numbers (SourceNumber1 and SourceNumber2) are equal and returns a Boolean value.
NumberNotEquals
Determines if two numbers (SourceNumber1 and SourceNumber2) are not equal and returns a Boolean value.
NumberToString
Creates a string value of a number (Number); allows for PaddingDigits and CountSign; CountSign defaults to a Boolean value of true, which includes a minus sign in the PaddingDigits.
Remainder
Determines the remainder when dividing a number (Addend1) by another number (Addend2); allows for specifying Rounding Decimal Positions.
Subtract
Subtracts a number (Addend2) from another number (Addend1); allows for specifying Rounding Decimal Positions.
Comments
0 comments
Please sign in to leave a comment.