Function Windows API Class

CoerceCurrencyToDouble

Coerce a Currency value into a Double value. Return the Double value whose bytes have the same in-memory representation as the Currency value vcurValue. Inverse of the CoerceDoubleToCurrency Function.

Signature (Visual Basic / VBA)

Public Function CoerceCurrencyToDouble( _
    ByVal vcurValue As Currency _
    ) As Double

Code Example

    CoerceCurrencyToDouble(1) = 4.94065645841247E-320
    CoerceCurrencyToDouble(2) = 9.88131291682493E-320
    CoerceCurrencyToDouble(461168601842738.7904) = 2.0000000000001
    CoerceCurrencyToDouble(460718241880001.7408) = 1.00000000000002

Notes & Version History

Note Similar to but faster than using the MakeCurrency and CoerceToDouble functions.