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.Format (Currency, String, NumberFormatInfo)

Converts a numeric value to a String using the specified format string.

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

Parameters

value
The value to be formatted.
format
The format string.
info
The NumberFormatInfo instance used to format the number.

Return Value

The value is a String representation in a specified format.

Remarks

The Format method provides the functionality to convert a Currency numeric value to a string.

The info parameter specifies the NumberFormatInfo instance used to format the number. If info is null, the numeric format information is obtained from the current locale (see CultureInfo for more information on cultures).

If format is null or an empty string, the Currency value is formatted as if the string general format ("G") were specified.

Note that extrema, cannot always be converted back to Currency values after they have been formatted. For example, Currency.MinValue =-922,337,203,685,477.5807. In the Japanese NumberFormatInfo, CurrencyDecimalDigits = 0, and so MinValue becomes "-922,337,203,685,478", which cannot be converted back to a Currency value using the Parse method.

The NumberFormatInfo supplies information such as the characters to use for Currency and thousand separators, and the spelling and placement of currency symbols in monetary values. (See NumberFormatInfo for details concerning format strings.)

See Also

Currency Structure | Currency Members | System Namespace | Currency.Format Overload List | Object | String