StringExtensions.AsDecimal Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AsDecimal(String) |
Converts a string to a Decimal number. |
AsDecimal(String, Decimal) |
Converts a string to a Decimal number and specifies a default value. |
AsDecimal(String)
AsDecimal(String, Decimal)
Converts a string to a Decimal number and specifies a default value.
public static decimal AsDecimal (this string value, decimal defaultValue);
static member AsDecimal : string * decimal -> decimal
<Extension()>
Public Function AsDecimal (value As String, defaultValue As Decimal) As Decimal
Parameters
- value
- String
The value to convert.
- defaultValue
- Decimal
The value to return if value
is null or invalid.
Returns
The converted value.