NumberFormatInfo.GetInstance(IFormatProvider) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the NumberFormatInfo associated with the specified IFormatProvider.
public:
static System::Globalization::NumberFormatInfo ^ GetInstance(IFormatProvider ^ formatProvider);
public static System.Globalization.NumberFormatInfo GetInstance (IFormatProvider formatProvider);
public static System.Globalization.NumberFormatInfo GetInstance (IFormatProvider? formatProvider);
static member GetInstance : IFormatProvider -> System.Globalization.NumberFormatInfo
Public Shared Function GetInstance (formatProvider As IFormatProvider) As NumberFormatInfo
Parameters
- formatProvider
- IFormatProvider
The IFormatProvider used to get the NumberFormatInfo.
-or-
null
to get CurrentInfo.
Returns
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 null
or if IFormatProvider.GetFormat returns null
, this method returns CurrentInfo.
Your application gets a NumberFormatInfo object for a specific culture using one of the following methods:
Through the CultureInfo.NumberFormat property.
Through the GetInstance method where
provider
is a CultureInfo.
A NumberFormatInfo object is 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.