DbiBcdFromFloat

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

DbiBcdFromFloat

Return to chapter overview

C syntax

DBIResult DBIFN DbiBcdFromFloat (piVal, iPrecision, iPlaces, pBcd);

Delphi syntax

function DbiBcdFromFloat (var iVal: Double; iPrecision: Word; iPlaces: Word; var Bcd: FMTBcd): DBIResult stdcall;

Description

DbBcdFromFloat converts a number in the BDE logical FLOAT format into the BDE logical binary coded decimal (BCD) format.

Parameters

piVal

Type: pDFLOAT

(Input)

Specifies the FLOAT data to convert.

iPrecision

Type: UINT16

(Input)

Specifies the precision of the BCD number. This number must be 32 for Paradox fields and usually the iUnits1 value for other drivers.

iPlaces

Type: UINT16

(Input)

Specifies the number of decimals of the BCD number.

pBcd

Type: pFMTBcd

(Output)

Pointer to the client buffer that receives  the BCD number (FMTBcd). The BDE logical BCD format has a  length which equals (iPrecision 2).

Usage

Due to a lack of high precision support for floating point values on the Intel platform, using the functions DbiBcdFromFloat and DbiBcdToFloat to convert values with more than 14 significant digits is not recommended. To convert high precision values on the Intel platform, develop a manual conversion routine that uses the information in the FMTBcd structure.

See Also

DbiBcdToFloat