Math filters are various operations in Xano to perform math and calculations. Like all filters you can chain math filters together and nest them inside one another to perform order of operations.
INPUTS: x (numeric) A single number to be formatted, decimals (numeric) Number of decimal points, decimalpoint (string) Decimal point separator, separator (string) Thousands separator
OUTPUT: Outputs the formatted number
pow(x, exp)
Returns the value raised to the power of exp.
Ex: pow(2,3) -> 8
INPUTS: x (numeric) A single number, the base exp (numeric) A single number, the exponent
OUTPUT: Outputs the base raised to the power of the exponent
rad2deg(x)
Convert radians to degrees.
Ex: rad2deg(pi) -> 180
INPUTS: x(numeric) A single number in radians
OUTPUT: Outputs the input value converted to degrees
round(x, precision)
Round a decimal with optional precision.
Ex: round(3.14159265,3) -> 3.142
INPUTS: x(numeric) A single number to be rounded precision (numeric) Number of decimal places to round to
OUTPUT: Outputs the input value rounded to the specified number of decimal places
sin(x)
Calculates the sine of the supplied value in radians.
Ex: sin(pi/2) -> 1
INPUTS: xsqrt(x) Returns the square root of the value
Examples: Find the square root of 9: sqrt(9) OUTPUT: 3
INPUTS: x (numeric) A single number
OUTPUT: Outputs the square root of the input value (numeric) A single number in radians
OUTPUT: Outputs the sine of the input value
sqrt(x)
Returns the square root of the value
Ex: sqrt(9) ->3
INPUTS: x (numeric) A single number
OUTPUT: Outputs the square root of the input value
subtract(x, y)
Subtract 2 values together and return the answer.
Ex: subtract(10,5) -> 5
INPUTS: x (numeric), y(numeric) Two numbers
OUTPUT: Outputs the result of subtracting y from x
tan(x)
Calculates the tangent of the supplied value in radians.
Ex: tan(pi/4) -> 1
INPUTS: x (numeric) A single number in radians
OUTPUT: Outputs the tangent of the input value
Special Array Math Filters:
array_max
Finds the max value among the values of the array.
Ex: max[2,5,3] -> 5
INPUTS: array[x1, x2,...] (array) an array of numbers to compare
OUTPUT: Outputs the largest number among the array.
array_min
Finds the minimum value among the values of the array.
Ex: min[2,5,3] -> 2
INPUTS: array[x1, x2,...] (array) an array of numbers to compare
OUTPUT: Outputs the smallest number among the array.
Product
Returns the product of the values of the array.
Ex: product[2,5,3] -> 30
INPUTS: array[x1, x2,...] (array) an array of numbers
OUTPUT: Outputs the product of the values of the array.
Sum
Returns the sum of the values of the array.
Ex: sum[2,5,3] -> 10
INPUTS: array[x1, x2,...] (array) an array of numbers
OUTPUT: Outputs the sum of the values of the array.