NumberFormatInfo.GetFormat(Type) 方法

定義

取得指定類型的物件,以提供數字格式化服務。Gets an object of the specified type that provides a number formatting service.

public:
 virtual System::Object ^ GetFormat(Type ^ formatType);
public object GetFormat (Type formatType);
abstract member GetFormat : Type -> obj
override this.GetFormat : Type -> obj
Public Function GetFormat (formatType As Type) As Object

參數

formatType
Type

必要格式服務的 TypeThe Type of the required formatting service.

傳回

如果 formatType 與目前 NumberFormatInfo 的類型相同,則為目前的 NumberFormatInfo,否則為 nullThe current NumberFormatInfo, if formatType is the same as the type of the current NumberFormatInfo; otherwise, null.

實作

備註

Format(String, IFormatProvider)目前NumberFormatInfo的做為IFormatProvider參數傳遞時,基底資料類型所支援的方法會叫用這個方法。The Format(String, IFormatProvider) methods supported by the base data types invoke this method when the current NumberFormatInfo is passed as the IFormatProvider parameter. 這個方法會實作 IFormatProvider.GetFormatThis method implements IFormatProvider.GetFormat.

適用於

另請參閱