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!

Currency.Parse (String, NumberStyles, NumberFormatInfo)

Converts a specified String to a Currency with the specified style and formatting.

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

Parameters

s
The string to be interpreted.
style
The permitted style of the numeric string.
info
The NumberFormatInfo instance used to format the string.

Return Value

A Currency with the value represented by the string.

Exceptions

Exception Type Condition
ArgumentException If style is not a combination of bit flags from the NumberStyles enumeration.
ArgumentNullException If the string is null.
FormatException If the string is not of the correct format.
OverflowException If the string represents a number that is outside the expected range.

Remarks

The Parse method converts (parses) a string to a Currency and applies a specified format style and formatting.

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

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 NumberStylesAny.

The style parameter must be a combination of bit flags from the NumberStyles enumeration.

The info parameter specifies the NumberFormatInfo instance used to format the string. If the info parameter is null the numeric format information is obtained from the locale of the current thread.An overflow exception will be thrown if the string represents a number that is less than MinValue or greater than MaxValue.

See Also

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