index

Varkon MBS Programmers manual

# outflt - Procedure

## Description

Converts a float to a string with optional formatting and writes the result to an open file or pipe.

## Syntax

      outflt(f, x, width, precision);

      file  f;
      float x;
      int   width;
      int   presicion;

## Principal parameters

f | - The name of a filevariable associated with a file open for write, append or update (W, A or U)
x | - The float to write

## Optional parameters

width | - Controls the amount of padding. If width is less than the actual space required no padding
| is performed. If width is larger than the space required the result is padded with blanks.
| The sign of width controls weather padding is done on the left side of the result (+) or the
| right side (-). If not specified, width is set to zero = no padding.
precision | - Controls the number of decimal places. A value of -1 gives E-notation.

## Examples

      outflt(f, 12345.0) => "12345"

      outflt(f, 12345.0, 10) => "     12345"

      outflt(f, 12345.0, -10) => "12345     "

      outflt(f, 12345.0, -10, 2) => "12345.00  "

      outflt(f, 12345.0, 10, -1) => " 1.2345e+04"

## See also

outint() and str()

Varkon version 1.19E svn# 121M