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. For convenience they are divided into the submenus on which they occur.


Integer

As Integer

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

As Integer Padded to 2

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.

Boolean

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.

Decimal

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 Decimal Number (.1)

A decimal number is extracted. A maximum of 1 fractional digit is returned.

As Decimal Number (.2)

A decimal number is extracted. A maximum of 2 fractional digits are returned.

As Decimal Number (.3)

A decimal number is extracted. A maximum of 3 fractional digits are returned.

As Decimal Number (.4)

A decimal number is extracted. A maximum of 4 fractional digits are returned.

Roman Numerals


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

Hexadecimal


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 (0x)

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

As Hexadecimal (2)

A decimal integer is extracted, anded with 0xFF, and returned as two hexadecimal digits.

As Hexadecimal (4)

A decimal integer is extracted, anded with 0xFFFF, and returned as four hexadecimal digits.

As Hexadecimal (8)

A decimal integer is extracted, anded with 0xFFFFFFFF, and returned as eight hexadecimal digits.

As Hexadecimal (16)

A decimal integer is extracted and returned as sixteen hexadecimal digits.

Formatted Display


As Hexadecimal Formatted Display

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

As Binary Formatted Display

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

Unicode


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.