NumberFormatInfo.GetFormat(Type) NumberFormatInfo.GetFormat(Type) NumberFormatInfo.GetFormat(Type) NumberFormatInfo.GetFormat(Type) Method

定义

获取提供数字格式化服务的指定类型的对象。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 Type Type 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.

适用于

另请参阅