WSO2 Data Mapper Operators - Arithmetic category
This post describes about the operators in the Arithmetic category
This operator can be used to add two or more numbers
1.Drag and drop the operator to the editor
2. To configure the number of inputs, right click and select “Configure Add Operator” menu action and then you can add the number of inputs you require to add
Eg:Adds the calories and count and maps the result to value
This operator can be used to subtract two numbers
Eg: Subtract 5 from calories and map the result
This can be used to multiply two or more numbers
1. Drag and drop the operator to the editor
2. To configure the number of inputs, right click and select “Configure Multiply Operator” menu action and then you can add the number of inputs you require
Eg: Multiplies the calories by 1% and map the result
This can be used to divide two numbers
Eg: Divide the calories by 2 and map the result
This can be used to derive the ceiling value of a number (the least integer that is greater than the input value)
Eg:Maps the ceiling value of the price
This can be used to derive the floor value of a number (the greatest integer that is less than the input value)
Eg:Maps the floor value of the price
This can be used to derive the next integer value by either increasing or decreasing the number
Eg: Get the round value of price
This can be used to specify a number into a specified length.
Eg: Nmber as 5.5433
Number of decimals as 2
The result would be 5.54
1.Drag and drop the operator to the editor
2. You can give the number which you need to convert into the first input box and the number of decimals to the other input box. No of decimals can be given in two ways as below-Can give via the dialog box by right click and select “Configure Set Precision Operator” menu action and specify the value for {$NoOfDigits}
-Can give as an input to the operator either using another operator as shown below or using the input value from the data mapper input tree
This can be used to derive the absolute value of a rational number
This can be used to derive the minimum number of the given set of numbers
1.Drag and drop the operator to the editor
2. Configure the operator to add the number of inputs by right click and select “Configure min operator” menu action
This can be used to derive the maximum number of the given set of numbers
1.Drag and drop the operator to the editor
2. . Configure the operator to add the number of inputs by right click and select “Configure max operator” menu action