Function Coerce Make Class

MakeDouble

"Make String From Double" or "Coerce Double To String" Coerce a Double (precision floating-point numeric) value into an 8-character string. Return an eight-character string containing the in-memory representation of the Double value vValue. Similar to coercing a double value into character string in the C language. Same as the MKD function in earlier versions of Microsoft Basic. Inverse of the CoerceToDouble function.

Signature (Visual Basic / VBA)

Public Function MakeDouble( _
    ByVal vValue As Variant _
    ) As Variant

Code Example

    MakeDouble(0) = String$(8, 0)
    MakeDouble(1) = String$(6, 0) + Chr$(240) + Chr$(63)
    MakeDouble(2) = String$(7, 0) + Chr$(64)
    MakeDouble(2.5) = String$(6, 0) + Chr$(4) + Chr$(64)
    MakeDouble("2") = String$(7, 0) + Chr$(64)
    IsNull(MakeDouble(Null)) = True

Parameters

Parameter Description
vValue The Double value whose bytes are to be interpreted as a string. vValue can be a numeric value, a date value, a numeric string, or a date string. Function returns Null if vValue is Null. Function returns an empty string if vValue cannot be fixed up to a number.

Notes & Version History

Note This function converts the string representation of the value to Unicode using the default code page of the system.
v1.3 Change Removed 16-bit support from this function.