Powered By Blogger

Jul 29, 2016

WSO2 Data Mapper Operators - Arithmetic category

This post describes about the operators in the Arithmetic category




  • Add
This operator can be used to add two or more numbers
1.Drag and drop the operator to the editor

add1.png


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 



add2.png

Eg:Adds the calories and count and maps the result to value

addex.png

  • Subtract
This operator can be used to subtract two numbers
subtract1.png
Eg: Subtract 5 from calories and map the result 


subEx2.png

  • Multiply
This can be used to multiply two or more numbers

1. Drag and drop the operator to the editor

mul1.png
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

mul2.png

Eg: Multiplies the calories by 1% and map the result



mulEx.png

  • Divide
This can be used to divide two numbers

divide1.png

Eg: Divide the calories by 2 and map the result



devideEx.png

  • Ceiling

This can be used to derive the ceiling value of a number (the least integer that is greater than the input value)

ceiling1.png
Eg:Maps the ceiling value of the price


ceilEx.png

  • Floor
This can be used to derive the floor value of a number (the greatest integer that is less than the input value)

floor1.png
Eg:Maps the floor value of the price

floorEx.png
  • Round
This can be used to derive the next integer value by either increasing or decreasing the number 

round.png

Eg: Get the round value of price



roundEx.png

  • Set Precision

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

setPre1.png

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} 

setPre2.png


setPre1.png
-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


setPre2.png 

  • Absolute value
This can be used to derive the absolute value of a rational number

abs 1.png

  • Min
This can be used to derive the minimum number of the given set of numbers

1.Drag and drop the operator to the editor

min1.png
2. Configure the operator to add the number of inputs by right click and select “Configure min operator” menu action

min2.png


  • Max
This can be used to derive the maximum number of the given set of numbers

1.Drag and drop the operator to the editor



max1.png
2. . Configure the operator to add the number of inputs by right click and select “Configure max operator” menu action


max2.png

No comments:

Post a Comment