StringExtensions.AsDecimal Method

Definition

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)

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

The value to convert.

Returns

The converted value.

Applies to

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.

Applies to