Math Formatters
Version 24.3.9110
Version 24.3.9110
- abs()
- add([value])
- and(value)
- ceiling()
- div([value])
- divide([value])
- floor()
- greaterthan(value[, ifgreater][, ifnotgreater])
- isbetween(integer_lowvalue, integer_highvalue[, ifbetween][, ifnotbetween])
- isequal(value[, ifequal][, ifnotequal])
- isgreater(value[, ifgreater][, ifnotgreater])
- isless(value[, ifless][, ifnotless])
- lessthan(value[, ifless][, ifnotless])
- mathadd([value])
- mathmod(value)
- mathpow([value])
- mathround([integer_value])
- mathsub([value])
- modulus(value)
- multiply([value])
- or(value)
- pow([value])
- rand([integer_value])
- random([integer_value])
- round([integer_value])
- sqrt()
- subtract([value])
Math Formatters
The list of formatters on this page perform mathematical operations. The syntax for all formatters is the same, as shown below:
[attr | formatter1() | formatter2()]
Attributes (variables) are piped in (using a vertical pipe character - |
) to formatters from left to right. The attribute that is piped into math formatters should always be a number or a boolean value (true
/false
, yes
/no
, or 1
/0
). For example, if the attribute myNum
is set to 5
, then the following line returns a value of 15
:
[myNum | multiply(3)]
abs()
Returns the absolute value of the numeric attribute value.
add([value])
Returns the sum of the numeric attribute value and the value that is specified by the parameter.
- value: The optional numeric value to add to the specified attribute value. The default value is
1
.
and(value)
Returns the AND of two values. The values that are provided on each side must be 1
/0
, yes
/no
, or true
/false
.
- value: The boolean value by which to compare.
ceiling()
Returns the smallest integer that is 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 by which to divide the numeric attribute value. The default value 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 by which to divide the numeric attribute value. The default value is
2
.
floor()
Returns the largest integer that is less than or equal to the numeric attribute value.
greaterthan(value[, ifgreater][, ifnotgreater])
Returns a value of true
(or ifgreater
) if the attribute value is greater than the parameter value; otherwise, a value of false
(or ifnotgreater
) is returned.
-
value: The numeric value to compare with the attribute value.
-
ifgreater: The optional value that is returned if the attribute value is greater than the parameter value.
-
ifnotgreater: The optional value that is returned if the attribute value is not greater than the parameter value.
isbetween(integer_lowvalue, integer_highvalue[, ifbetween][, ifnotbetween])
Returns a value of 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. Otherwise, a value of false
(or ifnotbetween
) is returned.
-
lowvalue: The lower bound of the range to check.
-
highvalue: The higher bound of the range to check.
-
ifbetween: The optional value that is 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 that is returned if the attribute value is less than the first parameter value or greater than the second parameter value.
isequal(value[, ifequal][, ifnotequal])
Returns a value of true
(or ifequal
) if the attribute value is equal to the parameter value; otherwise, a value of false
(or ifnotequal
) is returned.
-
value: The numeric value to compare with the attribute value.
-
ifequal: The optional value that is returned if the attribute value is equal to the parameter value.
-
ifnotequal: The optional value that is returned if the attribute value is not equal to the parameter value.
isgreater(value[, ifgreater][, ifnotgreater])
Returns a value of true
(or 1ifgreater1) if the attribute value is greater than the parameter value; otherwise, a value of false
(or ifnotgreater
) is returned.
-
value: The numeric value to compare with the attribute value.
-
ifgreater: The optional value that is returned if the attribute value is greater than the parameter value.
-
ifnotgreater: The optional value that is returned if the attribute value is not greater than the parameter value.
isless(value[, ifless][, ifnotless])
Returns a value of true
(or ifless
) if the attribute value is less than the parameter value; otherwise, a value of false
(or ifnotless
) is returned.
-
value: The numeric value to compare with the attribute value.
-
ifless: The optional value that is returned if the attribute value is less than the parameter value.
-
ifnotless: The optional value that is returned if the attribute value is not less than the parameter value.
lessthan(value[, ifless][, ifnotless])
Returns a value of true
(or ifless
) if the attribute value is less than the parameter value; otherwise, a value of false
(or ifnotless
) is returned.
-
value: The numeric value to compare with the attribute value.
-
ifless: The optional value that is returned if the attribute value is less than the parameter value.
-
ifnotless: The optional value that is returned if the attribute value is not less than the parameter value.
mathadd([value])
Returns the sum of the numeric attribute value and the value that is specified by the parameter.
- value: The optional numeric value to add to the specified attribute value. The default value is
1
.
mathmod(value)
Returns the modulus of the numeric attribute value divided by the specified parameter value.
- value: The number by which to divide the attribute value.
mathpow([value])
Returns the numeric attribute value raised to the power that is specified by the parameter value.
- value: The optional power to which to raise the attribute value. The default value 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, and so on.
- value: The optional number of decimal places. The default value is
2
.
mathsub([value])
Returns the difference between the numeric attribute value and the value specified by the parameter.
- value: The optional numeric value by which to subtract the attribute value.
modulus(value)
Returns the modulus of the numeric attribute value divided by the specified parameter value.
- value: The number by which to divide the attribute value.
multiply([value])
Returns the result of multiplying the numeric attribute value with the specified value of the parameter.
- value: The optional numeric value by which to multiply the numeric attribute value. The default value 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 that is raised to the power specified by the parameter value.
- value: The optional power by which to raise the attribute value. The default value 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. The default value 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. The default value is
100
.
round([integer_value])
Returns the numeric attribute value rounded to the number of decimal places that are specified by the parameter.
- value: The optional number of decimal places. The default value 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 that is specified by the parameter.
- value: The optional numeric value by which to subtract the attribute value.