$Unfloat

From m204wiki
Revision as of 13:18, 20 April 2013 by Alex (talk | contribs) (Automatically generated page update)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The $UNFLOAT function converts a floating-point number from the standard IBM floating point format to the corresponding character string representation. Model 204 maintains 15 significant decimal digits of precision for 8-byte floating-point numbers and 6 significant digits of precision for 4-byte floating-point numbers. For an expanded discussion of rounding numbers, please refer to Mapping and precision adjustment.

Syntax

The format of the $UNFLOAT function is:

$UNFLOAT(number)

where number can be either four bytes for a single-precision floating-point number or eight bytes for a double-precision floating-point number.

$UNFLOAT converts floating-point numbers from the internal form used by Model 204 for storage efficiency to a printable string. $UNFLOAT also allows the manipulation of these numbers by User Language.

Example

For example, the result of the expression:

$UNFLOAT($FLOAT('1.234'))

is the string 1.234. If the string argument is omitted or invalid, a null string is returned.