UNZONE
You can use the UNZONE function to convert a text item that represents a zoned (signed) number to an integer.
UNZONE converts a text item that can be interpreted as a number with a super-imposed sign in the rightmost byte (called zoned or signed data) to a signed integer item.
- Syntax:
- UNZONE ( single-text-expression )
- Meaning:
- UNZONE ( text_to_unzone )
- Returns:
- A single integer
UNZONE returns a signed integer representing the value text_to_unzone that is an integer in zoned (signed) format. If the text_to_unzone cannot be interpreted as a valid zoned number, UNZONE evaluates to "none".
Zoned integers have a series of digits except for the rightmost byte. The rightmost byte is a digit with a super-imposed sign. See "Positive zoned values" for a list of rightmost byte values.
Examples
- UNZONE ( "123D" )
Returns 1234
- UNZONE ( "1234" )
Returns 1234
- UNZONE ( TaxRate ) / 1000 * Income
TaxRate is converted from zoned format to a signed decimal and divided by 1000 (to convert it to a number with three decimal places), and then multiplied by Income.
You can define items as having a zoned character number presentation. Then, when mapping to or from these items, the conversion to and from zoned decimal is automatically performed as needed.
Related functions
- ZONE