SyntaxDim result As Decimal = CDec(expression)
DescriptionThe CDec function converts expression to the Decimal data type. Usage at a Glance
ExampleDim targetNumber As Decimal If IsNumeric(stringNumber) Then targetNumber = CDec(stringNumber) End If Version DifferencesThe Decimal data type replaces the VB 6 Currency data type, and it is appropriate for high-precision numbers. See AlsoVal Function |