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

Converts the value of the instance of Currency to a string using the specified format string.

[Visual Basic]
Overloads Overridable Public Function Format( _
   ByVal format As String, _
   ByVal sp As IServiceObjectProvider _
) As String
[C#]
public virtual string Format(
   string format,
   IServiceObjectProvider sp
);
[C++]
public: virtual String* Format(
   String* format,
   IServiceObjectProvider* sp
);
[JScript]
public function Format(
   format : String,
   sp : IServiceObjectProvider
) : String;

Parameters

format
The format string.
sp
The IServiceObjectProvider is used asked for the NumberFormatInfo used to format the String.

Return Value

The value is a String representation of this instance in the specified format.

Remarks

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

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" that cannot be converted back to a Currency value using the Parse method.

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

The sp parameter returns the format provider from which the NumberFormatInfo instance will be obtained. NumberFormatInfo supplies information such as the characters to use for decimal and thousand separators, and the spelling and placement of currency symbols in monetary values. If sp is null, the numeric format information is obtained from the current locale (see CultureInfo for more infomation on cultures).

See NumberStyles and NumberFormatInfo for details concerning format strings.

See Also

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