Export (0) Print
Expand All

CultureInfo.GetFormat Method

Gets an object that defines how to format the specified type.

Namespace:  System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

public virtual Object GetFormat(
	Type formatType
)

Parameters

formatType
Type: System.Type
The type to get a formatting object for. This method supports only the NumberFormatInfo and DateTimeFormatInfo types.

Return Value

Type: System.Object
The value of the NumberFormat property, if formatType is a Type object that represents the NumberFormatInfo class. This value is a NumberFormatInfo object that contains numeric formatting information for this CultureInfo object,
-or-
The value of the DateTimeFormat property, if formatType is a Type object that represents the DateTimeFormatInfo class. This value is a DateTimeFormatInfo object that contains date and time formatting information for this CultureInfo object,
-or-
null, if formatType is any other object.

Implements

IFormatProvider.GetFormat(Type)

GetFormat implements IFormatProvider.GetFormat. Typically, this method is not called directly from user code. Instead, it is called by parsing and formatting methods such as Int32.Parse(String, IFormatProvider) or DateTime.ToString(String, IFormatProvider).

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft