C5_SET DECIMALS

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()

 

Advertisements

4 responses to “C5_SET DECIMALS

  1. Pingback: C5 UI Global Settings | Viva Clipper !

  2. Pingback: C5 User Interface | Viva Clipper !

  3. Pingback: C5 Commands | Viva Clipper !

  4. Pingback: C5_SET FIXED | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.