[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
SET DECIMALS
Set the number of decimal places to be displayed
------------------------------------------------------------------------------
Syntax
SET DECIMALS TO [<nDecimals>]
Arguments
TO <nDecimals> is the number of decimal places to be displayed. The
default value is two.
SET DECIMALS TO with no argument is equivalent to SET DECIMALS TO 0.
Description
SET DECIMALS determines the number of decimal places displayed in the
results of numeric functions and calculations. Its operation depends
directly on the FIXED setting. If FIXED is OFF, SET DECIMALS
establishes the minimum number of decimal digits displayed by EXP(),
LOG(), SQRT(), and division operations. If FIXED is ON, all numeric
values are displayed with exactly the number of decimal places specified
by SET DECIMALS. Note that neither SET DECIMALS nor SET FIXED affects
the actual numeric precision of calculations--only the display format is
affected.
To provide finer control of numeric display, you can use the PICTURE
clause of @...SAY, @...GET, and the TRANSFORM() function.
Examples
. These examples show various results of the SET DECIMALS
command:
SET FIXED ON
SET DECIMALS TO 2 // The default setting
? 2/4 // Result: 0.50
? 1/3 // Result: 0.33
SET DECIMALS TO 4
? 2/4 // Result: 0.5000
? 1/3 // Result: 0.3333
Files Library is CLIPPER.LIB.
See Also:
@...GET
@...SAY
SET FIXED
TRANSFORM()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson