FT_E2D

FT_E2D()
 Convert scientific notation string to a decimal
------------------------------------------------------------------------------

 Syntax

            FT_E2D( <cNumE> )  -> <nDec>

 Arguments

                <cNumE>   Scientific notation string to convert

 Returns

                <nDec>    Decimal number

 Description

                Given a string in the format  x.yEz, the decimal
                equivalent is returned.

 Examples

                ? FT_E2D( "1.23E1" )
                  -> 12.3

                ? FT_E2D( "-1.235E1" )
                  -> -12.35

                ? ft_d2e( "5.43E-6" )
                  -> 0.0000543

 Source: E2D.PRG

 Author: Gary Baren

See Also: FT_D2E()

FT_DEC2BIN

FT_DEC2BIN()
 Convert decimal to binary

 Syntax

      FT_DEC2BIN( <nNum> ) -> cBinaryNumber

 Arguments

     <nNum> is the numeric expression to be converted.

 Returns

     A character string representing <nNum> in binary format.

 Description

     This function can be used in conjunction with any bit-wise
     operations.

 Examples

     QOut( FT_DEC2BIN(255) )        // "11111111"
     QOut( FT_DEC2BIN(2) )          // "00000010"

 Source: DECTOBIN.PRG

 Author: Greg Lief

FT_D2E

FT_D2E()
 Convert decimal to scientific notation
------------------------------------------------------------------------------

 Syntax

            FT_D2E( <nDec>, <nPrecision> )  -> <cNumE>

 Arguments

                <nDec>         Decimal number to convert

                <nPrecision>   Number of decimal places in result.
                     Defaults to 6 decimal places.

 Returns

                <cNumE>        A string representing a number in
                     scientific notation

 Description

                Given a decimal number and the desired precision,
                a string representing the equivalent in scientific
                notation is returned.

 Examples

                ? FT_D2E( 12.345, 2 )
                  -> 1.23E1

                ? FT_D2E( -12.345, 3 )
                  -> -1.235E1

                ? FT_D2E( 0.00000543, 2 )
                  -> 5.43E-6

 Source: D2E.PRG

 Author: Gary Baren

See Also: FT_E2D()



FT_BYT2HEX

FT_BYT2HEX()
 Convert byte to hexadecimal version of its binary value

 Syntax

      FT_BYT2HEX( cByte ) -> cHexValue

 Arguments

     <cByte> is the byte to convert.

 Returns

     Three-character string, consisting of two digits of hexadecimal
     notation and letter 'h' to signify hex.  Returns NIL if parameters are
     faulty.

 Description

     Can be used to show results of bit manipulation, both before and after.

     This function is presented to illustrate that bit-wise operations
     are possible with Clipper code.  For greater speed, write .C or
     .ASM versions and use the Clipper Extend system.

 Examples

     These three code lines perform a bitwise AND on bytes with values of
     CHR(20) and CHR(36), and deliver the result as a string in hexadecimal
     format, using 'h' to signify hexadecimal.

          ? FT_BYT2HEX(CHR(20))         // byte1: '14h'
          ? FT_BYT2HEX(CHR(36))         // byte2: '24h'

          ? FT_BYT2HEX(FT_BYTEAND(CHR(20), CHR(36)))
                             // result: '04h'

     For a demonstration of Clipper bit manipulations, compile and
     link the program BITTEST.PRG in the Nanforum Toolkit source code.

 Source: BYT2HEX.PRG

 Author: Forest Belt, Computer Diagnostic Services, Inc.

See Also: FT_BYT2BIT()



FT_BYT2BIT

FT_BYT2BIT()
 Convert byte to string of 1's and 0's

 Syntax

      FT_BYT2BIT( <cByte> ) -> cBitPattern

 Arguments

     <cByte> is the byte to convert.

 Returns

     9-character string, consisting of 1's and 0's, representing bits 0
     through 7 of parameter byte, with space between bits 3 and 4.  Returns
     NIL if parameters are faulty.

 Description

     Can be used to show results of bit manipulation, both before and after.
     Binary representation follows right-to-left convention of bit position
     numbering, 0 through 7.  Space between high and low nibbles for clarity
     and easy comparison to hexadecimal notation.

     This function is presented to illustrate that bit-wise operations
     are possible with Clipper code.  For greater speed, write .C or
     .ASM versions and use the Clipper Extend system.

 Examples

     These three code lines perform a bitwise AND on bytes with values of
     CHR(20) and CHR(36), and deliver the result as a string in binary (bit)
     format.

          ? FT_BYT2BIT(CHR(20))         // byte1: '0001 0100'
          ? FT_BYT2BIT(CHR(36))         // byte2: '0010 0100'

          ? FT_BYT2BIT(FT_BYTEAND(CHR(20), CHR(36)))
                             // result: '0000 0100'

     For a demonstration of Clipper bit manipulations, compile and
     link the program BITTEST.PRG in the Nanforum Toolkit source code.

 Source: BYT2BIT.PRG

 Author: Forest Belt, Computer Diagnostic Services, Inc.

See Also: FT_BYT2HEX()