Click or drag to resize
ConvertToDecimal Method (String)
Converts the specified string representation of a number to an equivalent decimal number.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static decimal ToDecimal(
	string value
)

Parameters

value
Type: SystemString
A string that contains a number to convert.

Return Value

Type: Decimal
A decimal number that is equivalent to the number in value, or 0 (zero) if value is null.
Exceptions
ExceptionCondition
FormatExceptionvalue is not a number in a valid format.
OverflowExceptionvalue represents a number that is less than MinValue or greater than MaxValue.
See Also