$Unfloat: Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
m (Mlarocca moved page $UNFLOAT to $Unfloat: Lower case change)
 
(No difference)

Latest revision as of 15:27, 31 July 2014

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.