NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Decimal.Parse (String, NumberStyles, NumberFormatInfo)

Converts a String representation of a value to a Decimal.

[Visual Basic]
Overloads Public Shared Function Parse( _
   ByVal s As String, _
   ByVal style As NumberStyles, _
   ByVal info As NumberFormatInfo _
) As Decimal
[C#]
public static Decimal Parse(
   string s,
   NumberStyles style,
   NumberFormatInfo info
);
[C++]
public: static Decimal Parse(
   String* s,
   NumberStyles style,
   NumberFormatInfo* info
);
[JScript]
public static function Parse(
   s : String,
   style : NumberStyles,
   info : NumberFormatInfo
) : Decimal;

Parameters

s
The String to convert a Decimal.
style
The permitted style of the numeric string.
info
The NumberFormatInfo instance used to format the string.

Return Value

A Decimal with the value represented by s.

Exceptions

Exception Type Condition
ArgumentException If the string is null.
ArgumentException If the style is not a combination of bit flags from the NumberStyles enumeration.
FormatException If the string is not of the correct format.
OverflowException If the string represents a number that is less than Decimal.MinValue or greater than Decimal.MaxValue.

Remarks

Note that the Parse methods do not accept positive or negative infinity or NaN.

If s has been created by one of the Format methods using C, D, E, F, G, or N as the format specifier, it is guaranteed that s can be parsed when style is TBD.

style must be a combination of bit flags from the cpclaSystem.NumberStylesEnumeration enumeration.

The info parameter specifies the cpclaSystem.NumberFormatInfoClassinstance used to format the string. If the info parameter is null, the numeric format information is obtained from the current locale.

See Also

Decimal Structure | Decimal Members | System Namespace | Decimal.Parse Overload List