Export (0) Print
Expand All

NumberFormatInfo.GetInstance Method

Gets the NumberFormatInfo associated with the specified IFormatProvider.

[Visual Basic]
Public Shared Function GetInstance( _
   ByVal formatProvider As IFormatProvider _
) As NumberFormatInfo
[C#]
public static NumberFormatInfo GetInstance(
 IFormatProvider formatProvider
);
[C++]
public: static NumberFormatInfo* GetInstance(
 IFormatProvider* formatProvider
);
[JScript]
public static function GetInstance(
   formatProvider : IFormatProvider
) : NumberFormatInfo;

Parameters

formatProvider
The IFormatProvider used to get the NumberFormatInfo.

-or-

A null reference (Nothing in Visual Basic) to get CurrentInfo.

Return Value

The NumberFormatInfo associated with the specified IFormatProvider.

Remarks

This method uses the IFormatProvider.GetFormat method of formatProvider using NumberFormatInfo as the Type parameter. If formatProvider is a null reference (Nothing in Visual Basic) or if IFormatProvider.GetFormat returns a null reference (Nothing), this method returns CurrentInfo.

You can get a NumberFormatInfo for a specific culture using one of the following methods:

A NumberFormatInfo can be created only for the invariant culture or for specific cultures, not for neutral cultures. For more information about the invariant culture, specific cultures, and neutral cultures, see the CultureInfo class.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

See Also

NumberFormatInfo Class | NumberFormatInfo Members | System.Globalization Namespace | IFormatProvider

Show:
© 2014 Microsoft