# Math Formatters

Version 22.0.8483

# Math Formatters

Version 22.0.8483

The following is a list of formatters that perform mathematical operations. The syntax for all formatters is the same: attributes (variables) are “piped” in to formatters from left-to-right, e.g.:

`[attr | formatter1() | formatter2()]`

The attribute piped into Math Formatters should always be a number or a boolean value (true/false, yes/no, 1/0). For example, if the attribute ‘myNum’ is set to 5, then the following would return 15:

`[myNum | multiply(3)]`

## abs()

Returns the absolute value of the numeric attribute value.

Returns the sum of the numeric attribute value and the value specified by the parameter.

• value: The optional numeric value to add to the specified attribute value. Default is 1.

## and(value)

Returns the AND of two values. The values provided on each side must be 1/0, yes/no or true/false.

• value: The boolean value to compare by.

## ceiling()

Returns the smallest integer greater than or equal to a numeric attribute value.

## div([value])

Returns the result of dividing the numeric attribute value by the specified value of the parameter.

• value: The optional numeric value to divide the numeric attribute value by. Default is 2.

## divide([value])

Returns the result of dividing the numeric attribute value by the specified value of the parameter.

• value: The optional numeric value to divide the numeric attribute value by. Default is 2.

## floor()

Returns the largest integer less than or equal to the numeric attribute value.

## greaterthan(value[, ifgreater][, ifnotgreater])

Returns true (or ifgreater) if the attribute value is greater than the parameter value, false (or ifnotgreater) otherwise.

• value: The numeric value to compare with the attribute value.
• ifgreater: The optional value returned if the attribute value is greater than the parameter value.
• ifnotgreater: The optional value returned if the attribute value is not greater than the parameter value.

## isbetween(integer_lowvalue, integer_highvalue[, ifbetween][, ifnotbetween])

Returns true (or ifbetween) if the attribute value is greater than or equal to the first parameter value and less than or equal to the second parameter value, false (or ifnotbetween) otherwise.

• lowvalue: The lower bound of the range to check.
• highvalue: The higher bound of the range to check.
• ifbetween: The optional value returned if the attribute value is greater than or equal to the first parameter value and less than or equal to the second parameter value.
• ifnotbetween: The optional value returned if the attribute value is less than the first parameter value or greater than the second parameter value.

## isequal(value[, ifequal][, ifnotequal])

Returns true (or ifequal) if the attribute value is equal to the parameter value, false (or ifnotequal) otherwise.

• value: The numeric value to compare with the attribute value.
• ifequal: The optional value returned if the attribute value is equal to the parameter value.
• ifnotequal: The optional value returned if the attribute value is not equal to the parameter value.

## isgreater(value[, ifgreater][, ifnotgreater])

Returns true (or ifgreater) if the attribute value is greater than the parameter value, false (or ifnotgreater) otherwise.

• value: The numeric value to compare with the attribute value.
• ifgreater: The optional value returned if the attribute value is greater than the parameter value.
• ifnotgreater: The optional value returned if the attribute value is not greater than the parameter value.

## isless(value[, ifless][, ifnotless])

Returns true (or ifless) if the attribute value is less than the parameter value, false (or ifnotless) otherwise.

• value: The numeric value to compare with the attribute value.
• ifless: The optional value returned if the attribute value is less than the parameter value.
• ifnotless: The optional value returned if the attribute value is not less than the parameter value.

## lessthan(value[, ifless][, ifnotless])

Returns true (or ifless) if the attribute value is less than the parameter value, false (or ifnotless) otherwise.

• value: The numeric value to compare with the attribute value.
• ifless: The optional value returned if the attribute value is less than the parameter value.
• ifnotless: The optional value returned if the attribute value is not less than the parameter value.

Returns the sum of the numeric attribute value and the value specified by the parameter.

• value: The optional numeric value to add to the specified attribute value. Default is 1.

## mathmod(value)

Returns the modulus of the numeric attribute value divided by the specified parameter value.

• value: The number to divide the attribute value by.

## mathpow([value])

Returns the numeric attribute value raised to the power specified by the parameter value.

• value: The optional power to raise the attribute value to. Default is 2.

## mathround([integer_value])

Returns the numeric attribute value rounded to the number of decimal places specified by the parameter; additionally inserts comma separators for thousands, millions, etc.

• value: The optional number of decimal places. Default is 2.

## mathsub([value])

Returns the difference between the numeric attribute value and the value specified by the parameter.

• value: The optional numeric value to subtract the attribute value by.

## modulus(value)

Returns the modulus of the numeric attribute value divided by the specified parameter value.

• value: The number to divide the attribute value by.

## multiply([value])

Returns the result of multiplying the numeric attribute value with the specified value of the parameter.

• value: The optional numeric value to multiply the numeric attribute value by. Default is 2.

## or(value)

Returns the OR of two values. The values provided on each side must be 1/0, yes/no or true/false.

• value: The boolean value to compare by.

## pow([value])

Returns the numeric attribute value raised to the power specified by the parameter value.

• value: The optional power to raise the attribute value to. Default is 2.

## rand([integer_value])

Returns a random integer between 0 and the parameter value.

• value: The optional value that limits the highest possible random integer. Default is 100.

## random([integer_value])

Returns a random integer between 0 and the parameter value.

• value: The optional value that limits the highest possible random integer. Default is 100.

## round([integer_value])

Returns the numeric attribute value rounded to the number of decimal places specified by the parameter.

• value: The optional number of decimal places. Default is 2.

## sqrt()

Returns the square root of the numeric attribute value.

## subtract([value])

Returns the difference between the numeric attribute value and the value specified by the parameter.

• value: The optional numeric value to subtract the attribute value by.