Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>set fixed</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SET FIXED


Syntax:     SET FIXED on/OFF/(<expL>)

Purpose:    To toggle control of the display of numeric output by the
            current DECIMALs SETting.

Options:    On: When FIXED is ON, display of all numeric output is
            controlled by the DECIMALS SETting (two places if the SET
            DECIMALS default value is in effect).

            Off: When FIXED is OFF, display of numeric output is
            dependent on the type of operation that produced the numeric
            value.  The following rules apply:


            Table: Numeric Decimal Display When FIXED Is OFF
            ----------------------------------------------------------
               Operation               Decimal Digits Displayed
            ----------------------------------------------------------
               Addition/subtraction    Same as operand with the
                                       greatest number of decimal digits
               Multiplication          Sum of operand decimal digits
               Division                SET DECIMALS
               Exponentiation          SET DECIMALS
               EXP(), LOG(), SQRT()    SET DECIMALS
               VAL()                   Same as operand
            ----------------------------------------------------------

            Note that neither SET FIXED nor SET DECIMALS affects the
            actual numeric precision of calculations.  Only the display
            format is affected.

Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   SET DECIMALS TO 2
   SET FIXED OFF

   ? 10.123456 + 10.12           && Result: 20.243456
   ? 10.123456 - 10.12           && Result: 0.003456
   ? 10.123456 * 10.12           && Result: 102.44937472
   ? 10.123456 / 10.12           && Result: 1.00
   ? 10.123456 **10.12           && Result: 14925450623.15
   ? EXP(10.123456)              && Result: 24920.75
   ? LOG(10.123456)              && Result: 2.31
   ? SQRT(10.123456)             && Result: 3.18
   ? VAL(STR(10.123456, 12, 7))  && Result: 10.1234560


See Also: SET DECIMALS EXP() LOG() SQRT() VAL()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson