# Form Calculation: Math Function Reference

July 24, 2022

The following advanced mathematical functions are available in the Form Calculation Widget and when using the Update/Calculate Field Conditional Logic.

You can use this guide as your reference to build perfect calculation forms.

## Math Functions

The arguments can either be fixed or variable from the form fields.

Function Description
abs() Returns the absolute (positive) value of a number.
abs(-100) = 100
acos() Returns the arc cosine of a number.
acos(0.5) = 1.05
asin() Returns the arc sine of a number.
asin(0.5) = 0.52
atan() Returns the arc tangent of a number in radians.
atan(1) = 0.7854
atan2() Returns the arc tangent of two variables x and y.
atan2(4, 8) = 0.4636
ceil() Rounds a number up to the nearest integer.
ceil(1.3) = 2
cos() Returns the cosine of a number.
cos(2) = -0.42
exp() Returns e raised to the power of a given number.
exp(1) = 2.7183
floor() Rounds a number down to the nearest integer.
floor(1.7) = 1
log() Returns the natural logarithm of a number.
log(2) = 0.69
max() Returns the highest value.
max(4, 8, 2) = 8
min() Returns the lowest value.
min(1, 2, 5) = 1
pow() Returns x raised to the power of y.
pow(2, 3) = 8
random() Generates a random float between 0 and 1.
random() * 100 = a random number between 0 and 100
round() Rounds a number to the nearest integer.
round(2.5) = 3
sin() Returns the sine of a number.
sin(3) = 0.14
sqrt() Returns the square root of a number.
sqrt(25) = 5
tan() Returns the tangent of a number.
tan(45) = 1.62
E Return the Euler’s number.
E * 1 = 2.7183
LN2 Returns the natural logarithm of 2.
LN2 * 1 = 0.6931
LN10 Returns the natural logarithm of 10.
LN10 * 1 = 2.3026
LOG2E Returns the base-2 logarithm of E.
LOG2E * 1 = 1.4427
LOG10E Returns the base-10 logarithm of E.
LOG10E * 1 = 0.4343
PI Returns the value of PI.
PI * 1 = 3.1416
SQRT1_2 Return the square root of 1/2.
SQRT1_2 * 1 = 0.7071
SQRT2 Return the square root of 2.
SQRT2 * 1 = 1.4142
avg() Returns the average of supplied numbers.
avg(0, 2, 4) = 2
avgNoZero() Returns the average of supplied numbers while excluding zeroes and empty fields.
avgNoZero(0, 2, 4) = 3
count() Returns the number of selected options in a Multiple Choice or Single Choice element.
commaSeparate()  Include comma separators in large numbers.
commaSeparate(1234567) = 1,234,567.00
dateString() Converts a Date Picker’s value (or epoch time in days) to a date string in “D M d Y” format.
dateString(12-25-2030) = Wed Dec 25 2030
nth() Returns the nth largest number.
nth(2, 20, 30, 40) = 30
minutes() Converts minutes to milliseconds.
minutes(1) = 60000
hours() Converts hours to milliseconds.
hours(1) = 3600000
days() Converts days to milliseconds.
days(1) = 86400000
weeks() Converts weeks to milliseconds.
weeks(1) = 604800000
months() Converts months to milliseconds.
months(1) = 2592000000
Contact Support:

Our customer support team is available 24/7 and our average response time is between one to two hours.
Our team can be contacted via: