$Eformat

From m204wiki
(Redirected from $EFORMAT)
Jump to navigation Jump to search

The $EFORMAT function converts numeric values to exponent notation. For a detailed discussion of exponent format refer to Exponent notation.

Syntax

The format of the $EFORMAT function is:

$EFORMAT(value,significant digits,fractional digits)

where arguments are:

  • value argument must contain the numeric value to be formatted. If this argument is passed to $EFORMAT with a nonnumeric or invalid value, $EFORMAT returns a zero.
  • significant digits argument must contain a positive integer identifying the number of significant digits to print. The default is 15. If this argument is passed to $EFORMAT with an invalid value, $EFORMAT returns a null string.
  • fractional digits argument must contain a positive integer identifying the number of significant digits to print to the right of the decimal point. The number of digits specified is always printed to the right of the decimal point, even if the digits are zero.
  • If this argument is omitted, all significant digits are printed with one digit placed to the left of the decimal point in the form hn.nn through nEnn. If this argument is passed to $EFORMAT with an invalid value, $EFORMAT returns a null string.

Example

BEGIN GET.FLOAT: FIND ALL RECORDS FOR WHICH FLOATFLD1 = 3444300E15 END FIND FOR EACH RECORD IN GET.FLOAT PRINT 'E FORMAT NUMBER IS ' WITH - $EFORMAT(FLOATFLD1,5,2) END FOR END

results in this output:

E FORMAT NUMBER IS 344.43E19