NumberFormatInfo.GetInstance(IFormatProvider) 方法

定義

取得與指定的 NumberFormatInfo 相關聯的 IFormatProviderGets the NumberFormatInfo associated with the specified IFormatProvider.

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

參數

formatProvider
IFormatProvider

IFormatProvider,用來取得 NumberFormatInfoThe IFormatProvider used to get the NumberFormatInfo.

-或--or- 若要取得null ,則為 CurrentInfonull to get CurrentInfo.

傳回

與指定 NumberFormatInfo 相關聯的 IFormatProviderThe NumberFormatInfo associated with the specified IFormatProvider.

備註

這個方法會使用IFormatProvider.GetFormatformatProvider方法NumberFormatInfo做為型別參數。This method uses the IFormatProvider.GetFormat method of formatProvider using NumberFormatInfo as the Type parameter. 如果formatProvider IFormatProvider.GetFormat CurrentInfonull ,或如果傳回,這個null方法會傳回。If formatProvider is null or if IFormatProvider.GetFormat returns null, this method returns CurrentInfo.

您的應用程式NumberFormatInfo會使用下列其中一種方法,取得特定文化特性的物件:Your application gets a NumberFormatInfo object for a specific culture using one of the following methods:

NumberFormatInfo物件只會針對不因文化特性而異,或針對特定文化特性而建立,而不是針對中性文化特性。A NumberFormatInfo object is created only for the invariant culture or for specific cultures, not for neutral cultures. 如需不因文化特性、特定文化特性和中性文化特性的詳細資訊CultureInfo ,請參閱類別。For more information about the invariant culture, specific cultures, and neutral cultures, see the CultureInfo class.

適用於

另請參閱