DoubleToBcd

Method
Converts a BCD (decimal number) to a double.

Category
BCD

 

Syntax
Sub DoubleToBcd(ByVal Number As Double, ByVal hBcd As Long)

Number
The double to be converted.

hBcd
The handle to the BCD number.

 

Example

hBCD = CF1.AllocBcd

  tmpDouble = 10

  CF1.DoubleToBcd tmpDouble, hBCD

  tmpVar = CF1.BcdToDouble(hBCD)

  If CDbl(tmpVar) = tmpDouble And VarType(tmpVar) = vbDouble Then

  logWr "DoubleToBCD and BCDToDouble OK"

  Else

  logWr "DoubleToBCD or BCDToDouble failed"

  End If

  CF1.FreeBcd hBCD

 

Comments
DoubleToBcd converts the double Number to a BCD. The BCD number is referenced by hBcd.



© 2009 Microsoft Corporation. All rights reserved.