HotDocs Author WorkflowCreate a template Add placeholders Group variables in dialogs Upload a template Create a script

INTEGER Function

The INTEGER function converts the text value you specify to a number value by scanning the text from left to right for a contiguous set of digits, stopping when it encounters a character that is not a digit; it then returns the contiguous digits it encounters as a number value. If no digits precede the first non-digit character, or if the text is empty, the function returns zero.

Function name INTEGER
Usage model INTEGER ( t:TEXT )
Parameters This function requires you to replace only one parameter:

t: TEXT

The function converts the text value to a number value.
Result A number value.

Examples

The following returns 12 because a “:” is not a digit so the scanning stops at that point.

INTEGER("12:00")

If Call Time has a value of "12:30", the following returns 12 because “:” is not a number so the scanning stops at that point.

INTEGER(Call Time)

If Call Time has a value of "12:30" and you want to retrieve the 30 as a number value, you can use the INTEGER function in conjunction with the MID and POSITION functions:

INTEGER(MID("12:30", 1 + POSITION("12:30", ":"), 2))

The result from POSITION(“12:30”, “:”) is calculated first, resulting in a position of 3 (i.e. the colon). We add 1 to the result from POSITION, making 4. The MID instruction will begin scanning from the fourth position and finds the last two characters in the text value. The INTEGER function then converts “30” to the number value 30.