Math Handlers

Created by Reachware Support, Modified on Wed, 18 Mar at 12:36 AM by Reachware Support

Math Handlers in Reachware Studio are predefined functions used to perform calculations, round numbers, and format numerical values during the mapping process. These handlers enable you to perform mathematical operations without writing custom code.

Accessing Math Handlers

1

Click on any destination field in the mapping panel

2

A pop-up window opens titled "MATH HANDLER"

3

You'll see two sections:

  • Handlers — Available math functions
  • Operators — Mathematical operators (+, -, *, /, %, <, >, etc.)

Available Math Handlers

sum()

sum([array of values])

Returns the total sum of all numeric values provided.

Example

sum([10, 20, 30, 40]) = 100

average()

average([array of values])

Returns the average value of numeric values in an array.

Example

average([10, 20, 30, 40]) = 25

ceil()

ceil(number)

Returns the smallest integer greater than or equal to the specified number (rounds up).

Example

ceil(4.3) = 5

floor()

floor(number)

Returns the largest integer less than or equal to the specified number (rounds down).

Example

floor(4.7) = 4

round()

round(number)

Rounds a number to the nearest integer. If the fractional part is 0.5 or greater, it rounds up; otherwise, it rounds down.

Example

round(3.7) = 4
round(3.2) = 3

max()

max([array of values])

Returns the largest value among the provided numbers or within an array.

Example

max(4, 6) = 6

min()

min([array of values])

Returns the smallest value among the provided numbers or within an array.

Example

min(3, 2) = 2

formatNumber()

formatNumber(number; decimalPlaces; thousandSeparator; decimalSeparator)

Converts a numeric value into a string, formatted according to specified rules.

Example

formatNumber(123456789; 3; ,; .)
= 123,456,789.000

abs()

abs(number)

Returns the absolute (positive) value of a number.

Example

abs(-3.7) = 3.7

Operators

Arithmetic Operators

OperatorDescriptionExample
+Addition2 + 3 = 5
"Hello" + " World" = "Hello World"
-Subtraction7 - 4 = 3
*Multiplication4 * 5 = 20
/Division10 / 2 = 5

Comparison Operators

OperatorDescriptionExample
<Less than3 < 5 = true
>Greater than6 > 2 = true
<=Less than or equal4 <= 4 = true
>=Greater than or equal5 >= 3 = true
==Equal (with type conversion)5 == "5" = true
===Strictly equal (no type conversion)5 === "5" = false
!=Not equal (with type conversion)5 != "6" = true
!==Strictly not equal5 !== "5" = true

Related Topics

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article