StringExtensions.AsDecimal StringExtensions.AsDecimal StringExtensions.AsDecimal Method

Definition

Overloads

AsDecimal(String) AsDecimal(String) AsDecimal(String)

Converts a string to a Decimal number.

AsDecimal(String, Decimal) AsDecimal(String, Decimal) AsDecimal(String, Decimal)

Converts a string to a Decimal number and specifies a default value.

AsDecimal(String) AsDecimal(String) AsDecimal(String)

Converts a string to a Decimal number.

public static decimal AsDecimal (this string value);
static member AsDecimal : string -> decimal
<Extension()>
Public Function AsDecimal (value As String) As Decimal
Parameters
value
String String String

The value to convert.

Returns

The converted value.

AsDecimal(String, Decimal) AsDecimal(String, Decimal) 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 String String

The value to convert.

defaultValue
Decimal Decimal Decimal

The value to return if value is null or invalid.

Returns

The converted value.

Applies to