Functions

A2J Author® has a number of built in functions which can be used in evaluations under the advanced tab. Some can also be used to return a value in the text of a question.

 

Name

Parameter

Purpose

Sample

Result

AGE

any date

Converts date to age in year

AGE([User Birthday])

20 if User Birthday is 1/1/1980 and the current date is 1/1/2000

DATE

date or days

Converts days into a mm/dd/yyyy date

DATE(TODAY+90)

the date 90 days from today

DOLLAR

number

Formats a number with commas and period

DOLLAR(38581.3)

38,581.30

HASANSWERED

a variable

Returns true if the variable has a value

HASANSWERED([middle name])

true if client typed in a middle name, false otherwise.

HISHER

gender

Returns his or her depending on gender

HISHER(User Gender)

“her” if User Gender is Female

HESHE

gender

Returns he or she depending on gender

HESHE(User Gender)

“he” if User Gender is Male

ORDINAL

number

Returns ordinal form of number

ORDINAL(5)

5th

ROUND

number

Round a number to an integer

ROUND(5.21)

5

ROUND2

number

Rounds a number to 2 places after decimal.

ROUND2(5.215)

5.22

SUM

repeating variable

Returns total of all the repeating variables

SUM([Asset Value])

If you asked for 3 asset values which are stored in a repeating variable, this would return the sum of these 3 values

TODAY

None

Returns today’s date

TODAY

Today’s date as a Date variable

TRUNC

number

Truncates a number to an integer

TRUNC(7.98)

7

TRUNC2

Number

Truncates a number at hundredth place.

TRUNC(7.479)

7.47