Function Convert Values Class

CDblIgnErr

"Convert To Double Ignore Errors" Attempt to convert vValue to a Double (precision floating-point) value. Return vValue as a Double value if the conversion was successful. Return 0 (zero) if vValue could not be converted to a Double.

Signature (Visual Basic / VBA)

Public Function CDblIgnErr( _
    ByVal vValue As Variant _
    ) As Double

Code Example

    CDblIgnErr(34) = 34#
    CDblIgnErr(0) = 0#
    CDblIgnErr(-34) = -34#
    CDblIgnErr(34.3) = 34.3#
    CDblIgnErr("1") = 1#
    CDblIgnErr("0") = 0#
    CDblIgnErr(#12/31/1899#) = 1#
    CDblIgnErr("Word") = 0#

Parameters

Parameter Description
vValue The value which will be converted to a Double and returned (if conversion is possible). Conversion is not possible if vValue is Null, an Error, an Object, a non-numeric String, or a numeric value out of the range allowed for this data type.