Application icon

Format Numeric

Yate functions requiring numeric values convert the text at the start of a field to an integer. If an integer cannot be constructed, 0 is assumed. This function saves the results of the conversion ignoring extra characters after the integer. The function can read decimal integer sequences and Roman numeral sequences. The function can output the integer as a decimal integer or Roman numeral.

You specify a track or named variable to be converted. If a named variable is specified it may contain any of the escape sequences described in Escape Sequences.

The following functions are available:

as integer
A decimal integer is extracted. eg. 4 Title --> 4

as integer padded to 2 digits
A decimal integer is extracted. Positive integers in the range of 0 to 99 are represented as two digits. All other integers are represented as is. eg. 4 Title --> 04

as integer padded to 3 digits
A decimal integer is extracted. Positive integers in the range of 0 to 999 are represented as three digits. All other integers are represented as is. eg. 4 Title --> 004

as integer padded to 4 digits
A decimal integer is extracted. Positive integers in the range of 0 to 9999 are represented as four digits. All other integers are represented as is. eg. 4 Title --> 0004

as integer (allow true)
A text string of true (case insensitive) will return 1, otherwise a decimal integer is extracted. This is useful when the data can contain decimal or boolean data.

As Integer or Empty
An integer value is extracted. If the value is 0 an empty string is returned, otherwise the integer value.

As Integer or Empty (allow true)
Same as As Integer or Empty but true will return 1.

as boolean
A text string of true (case insensitive) or any leading non zero value will return true, otherwise false.

as integer from boolean
A text string of true (case insensitive) will return 1 otherwise an integer is extracted. If the value is non zero the field will be set to 1, otherwise 0.

as 1 or empty from boolean
When extracting a numeric value, Yate typically treats non numeric text as being equivalent to 0. Rename Template's IfExists constructs, with a few exceptions, treat exists as non empty. When extending a rename template via an action you might wish to set up a track variable suitable for testing with an IfExists construct. A text string of true (case insensitive) will return 1 otherwise an integer is extracted. If the value is non zero the field will be set to 1, otherwise empty.

as integer from negated boolean
A text string of true (case insensitive) will return 0 otherwise an integer is extracted. If the value is non zero the field will be set to 0, otherwise 1.

as decimal number
A decimal number is extracted. If it does not have a fractional part, .0 is appended. Useful when a decimal number is desired for use in an expression.

as integer from Roman numeral
A Roman numeral sequence is converted to a decimal integer. The string is treated as case insensitive and leading and trailing spaces are ignored. An invalid Roman numeral sequence will return 0. The conversion stops with the first non Roman numeral digit or the end of the string. Note that if the stopping character is alphanumeric, the sequence is treated as invalid. ie. Life will return 0, not 50. The alternative forms IIII, IIIII, XXXX, XXXXX, CCCC, CCCCC are permitted. eg. XIV --> 14.

as Roman numeral from integer
A decimal integer is extracted and represented as a Roman numeral. Only positive integers in the range of 1 to 3999 can be represented. Any other value will be returned as an empty string. eg. 14 --> XIV

as integer from hexadecimal
A decimal integer is returned by accumulating hexadecimal digits optionally preceded by a 0x sequence. The conversion stops with the first non hexadedimal digit (excluding the optional 0x sequence).

as hexadecimal
A decimal integer is extracted and returned as a hexadecimal value preceded by a 0x sequence.

as hexadecimal display
A decimal integer is extracted and returned as a sequence of 16 hexadecimal digits with a space separating every four digits.

as binary display
A decimal integer is extracted and returned as a sequence of 64 binary digits with a space separating every eight digits.

as alphabetic index
If the first character in the source, ignoring alphabetic case and diacritic marks, is in the range of A through Z, a value of 1 through 26 is returned. Otherwise 0 is returned.

as integer value of Unicode character
An integer value representing the first Unicode character is returned. If the source is empty, -1 is returned. See the Unicode Strings topic for additional information which effect the usage of this function. This function can be done on an arbitrary string position via the Substring statement's Integer Value of Unicode Character function.

as hexadecimal value of Unicode character
A hexadecimal value representing the first Unicode character is returned. If the source is empty, an empty string is returned. If the source is not empty the returned value starts with a 0x sequence. See the Unicode Strings topic for additional information which effect the usage of this function.

As Unicode Character from Number
The number may be an integer or a hexadecimal number starting with a 0x sequence. The Unicode character represented by the value is returned. See the Unicode Strings topic for additional information which effect the usage of this function.

as UTF-16 sequence from Unicode character
A sequence of hexadecimal values separated by space characters. See the Unicode Strings topic for additional information on UTF-16. Each hexadecimal value consists of four characters and is not preceded by a 0x sequence.