[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 CALCDEC()
 To get/set the calculator predefined decimal positions.
------------------------------------------------------------------------------

 Syntax

      CALCDEC( [<nDecimals>] )  -> aOldDecimals

 Arguments

      <nDecimals> is an optional numeric parameter containing decimals
      to set for calculator operation.

      Defaults to -2 (automatically setting the decimals to whatever it
       receives through the get variable or the initialization parameter)

 Returns

      CALCDEC() returns the current CALCDEC() numeric setting.

 Description

      You may use CALCDEC() to get/set the calculator predefined decimal
      positions.

      Regarding the parameter <nDecimals>:

      . In the range zero to nine (0-9), it will FIX the decimals to
        that number, regardless of how it was received.

      . If it is a -1, it will FLOAT the decimals, regardless of how
        it was received.

      . If it is a -2, it will be floating unless the received value
        contains a decimal position in which it will fix that position.
        (This is the default behavior)

 Examples

     ** Example 1 - set decimals to 2

        //Positions the calculator to two decimals

        nOldDec := CALCDEC( 2 )

        Calculator(1.23456)       //shows 1.23 only!


     ** Example 2 - set decimals to 0

        //Positions the calculator to no decimals

        nOldDec := CALCDEC( 0 )

        Calculator(1.23456)       //shows 1 only!


     ** Example 3 - set decimals to FLOATING

        //Positions the calculator to floating decimal

        nOldDec := CALCDEC( -1 )

        Calculator(1.23456)       //shows 1.23456 without being fixed.


     ** Example 4 - set decimals to DEFAULT

        //Positions the calculator to default behavior

        nOldDec := CALCDEC( -2 )

        Calculator(1.23456)       //shows 1.23456 fixed!
        Calculator(1)             //shows 1       floating!



 Files: CALC.LIB

 Author: Touchstone Business Creations          CompuServe ID: 73670,2561
         28613 River Glen Ct. #1
         Menifee, CA 92584-8987 USA

         (909) 679-3364

 Owner : (c) Copyright, 1991,92,93 Touchstone Business Creations

See Also: CALCULATOR()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson