The information in this article applies to:
SYMPTOMSIn Microsoft Visual Basic, Applications Edition, the CDbl Function may return the incorrect value when you use a currency data type in the function. CAUSE
This behavior occurs because the Cdbl function uses the incorrect
conversion when you use a currency data type in the function.
In the above example, the CDbl function is used to convert the variable cy
(Currency data type) to Double data type. If this occurred correctly, the
result of subtracting Cdbl(cy) from x should be 0. This behavior occurs
because the conversion used with Currency data type incorrectly preserves
extra precision and the result is not zero.
STATUSMicrosoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION
You can use the CDbl Function to convert any valid numeric or string
expression to Double data type. For example, use CDbl to force double-
precision arithmetic in cases where currency or integer arithmetic normally
would occur.
REFERENCESFor more information about the CDbl Function, choose the Search button in the Visual Basic Reference, and type the following: CDbl Additional query words:
Keywords : |
Last Reviewed: October 21, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |