FIX()

FIX()

Top  Previous  Next

 

The FIX() function returns a string representation of a floating point value with a specified precision and optional truncation.

 

 

Format

 

FIX(expr {, prec{, truncate}})

 

where

 

exprevaluates to the data to be formatted

 

precevaluates to the required precision

 

truncateA Boolean value that determines whether the value should be rounded or truncated.

 

 

The FIX() function converts a floating point value to a character string.

 

The prec argument determines the number of decimal places in the result. If omitted, the current value of the program PRECISION is used. A precision less than 0 is treated as 0. A precision greater than 14 is treated as 14.

 

The truncate argument controls rounding. A value of False (0 or a null string) or omitting the argument causes rounding to be applied. Any other value causes truncation.

 

 

Examples

 

V = 12.3456789

DISPLAY FIX(V, 3)12.346
DISPLAY FIX(V, 3, 1)12.345