CultureInfo.GetFormat(Type) メソッド
定義
指定した型に書式指定する方法を定義するオブジェクトを取得します。Gets an object that defines how to format the specified type.
public:
virtual System::Object ^ GetFormat(Type ^ formatType);
public virtual object GetFormat (Type formatType);
abstract member GetFormat : Type -> obj
override this.GetFormat : Type -> obj
Public Overridable Function GetFormat (formatType As Type) As Object
パラメーター
- formatType
- Type
書式指定オブジェクトを取得する Type。The Type for which to get a formatting object. このメソッドは、NumberFormatInfo 型と DateTimeFormatInfo 型だけをサポートしています。This method only supports the NumberFormatInfo and DateTimeFormatInfo types.
戻り値
NumberFormat プロパティの値。formatType
が NumberFormatInfo クラスの CultureInfo オブジェクトの場合は、現在の Type の既定の数値書式情報が格納された NumberFormatInfo です。The value of the NumberFormat property, which is a NumberFormatInfo containing the default number format information for the current CultureInfo, if formatType
is the Type object for the NumberFormatInfo class.
または-or-
DateTimeFormat プロパティの値。formatType
が DateTimeFormatInfo クラスの CultureInfo オブジェクトの場合は、現在の Type の既定の日付および時刻の形式に関する情報が格納された DateTimeFormatInfo です。The value of the DateTimeFormat property, which is a DateTimeFormatInfo containing the default date and time format information for the current CultureInfo, if formatType
is the Type object for the DateTimeFormatInfo class.
または-or-
formatType
がその他のオブジェクトである場合は null。null, if formatType
is any other object.
実装
注釈
GetFormat は、IFormatProvider.GetFormat を実装します。GetFormat implements IFormatProvider.GetFormat.
NumberFormatInfo
基本データ型の書式指定メソッドと共に使用されるカルチャ固有の数値書式を提供します。NumberFormatInfo
provides the culture-specific numeric format used in conjunction with the Format methods in the base data types. DateTimeFormatInfo
特定のカルチャに対して日付と時刻の値を書式設定する方法を制御します。DateTimeFormatInfo
controls how the date and time values are formatted for a specific culture.