Defines how numeric values are formatted and displayed, depending on the culture.
Assembly: mscorlib (in mscorlib.dll)
Thetype exposes the following members.
|CurrencyDecimalDigits||Gets or sets the number of decimal places to use in currency values.|
|CurrencyDecimalSeparator||Gets or sets the string to use as the decimal separator in currency values.|
|CurrencyGroupSeparator||Gets or sets the string that separates groups of digits to the left of the decimal in currency values.|
|CurrencyGroupSizes||Gets or sets the number of digits in each group to the left of the decimal in currency values.|
|CurrencyNegativePattern||Gets or sets the format pattern for negative currency values.|
|CurrencyPositivePattern||Gets or sets the format pattern for positive currency values.|
|CurrencySymbol||Gets or sets the string to use as the currency symbol.|
|CurrentInfo||Gets a read-only that formats values based on the current culture.|
|DigitSubstitution||Gets or sets a value that specifies how the graphical user interface displays the shape of a digit.|
|InvariantInfo||Gets the default read-only that is culture-independent (invariant).|
|IsReadOnly||Gets a value indicating whether the is read-only.|
|NaNSymbol||Gets or sets the string that represents the IEEE NaN (not a number) value.|
|NativeDigits||Gets or sets a string array of native digits equivalent to the Western digits 0 through 9.|
|NegativeInfinitySymbol||Gets or sets the string that represents negative infinity.|
|NegativeSign||Gets or sets the string that denotes that the associated number is negative.|
|NumberDecimalDigits||Gets or sets the number of decimal places to use in numeric values.|
|NumberDecimalSeparator||Gets or sets the string to use as the decimal separator in numeric values.|
|NumberGroupSeparator||Gets or sets the string that separates groups of digits to the left of the decimal in numeric values.|
|NumberGroupSizes||Gets or sets the number of digits in each group to the left of the decimal in numeric values.|
|NumberNegativePattern||Gets or sets the format pattern for negative numeric values.|
|PercentDecimalDigits||Gets or sets the number of decimal places to use in percent values.|
|PercentDecimalSeparator||Gets or sets the string to use as the decimal separator in percent values.|
|PercentGroupSeparator||Gets or sets the string that separates groups of digits to the left of the decimal in percent values.|
|PercentGroupSizes||Gets or sets the number of digits in each group to the left of the decimal in percent values.|
|PercentNegativePattern||Gets or sets the format pattern for negative percent values.|
|PercentPositivePattern||Gets or sets the format pattern for positive percent values.|
|PercentSymbol||Gets or sets the string to use as the percent symbol.|
|PerMilleSymbol||Gets or sets the string to use as the per mille symbol.|
|PositiveInfinitySymbol||Gets or sets the string that represents positive infinity.|
|PositiveSign||Gets or sets the string that denotes that the associated number is positive.|
|Clone||Creates a shallow copy of the .|
|Equals(Object)||Determines whether the specified Object is equal to the current Object. (Inherited from Object.)|
|Finalize||Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)|
|GetFormat||Gets an object of the specified type that provides a number formatting service.|
|GetHashCode||Serves as a hash function for a particular type. (Inherited from Object.)|
|GetInstance||Gets the associated with the specified IFormatProvider.|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|MemberwiseClone||Creates a shallow copy of the current Object. (Inherited from Object.)|
|ReadOnly||Returns a read-only wrapper.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
This class contains information, such as currency, decimal separators, and other numeric symbols.
To create a object for a specific culture, your application creates a CultureInfo object for that culture and retrieves the CultureInfo.NumberFormat property. To create a object for the culture of the current thread, the application uses the CurrentInfo property. To create a object for the invariant culture, the application uses the InvariantInfo property for a read-only version, or uses the constructor for a writable version. It is not possible to create a object for a neutral culture.
The user might choose to override some of the values associated with the current culture of Windows through the regional and language options in Control Panel. For example, the user might choose to display the date in a different format or to use a currency other than the default for the culture. If the CultureInfo.UseUserOverride property is set to true, the properties CultureInfo.DateTimeFormat, CultureInfo.NumberFormat, and CultureInfo.TextInfo are also retrieved from the user settings. If the user settings are incompatible with the culture associated with the CultureInfo object, for example, if the selected calendar is not one of the OptionalCalendars, the results of the methods and the values of the properties are undefined.
For versions of .NET Framework prior to 2.0, if the application sets the CultureInfo.UseUserOverride property to true, the object reads each user-overridable property only when it is accessed for the first time. Because has more than one user-overridable property, this "lazy initialization" can lead to an inconsistency between such properties when the application accesses one property, the user changes to another culture or overrides properties of the current user culture through regional and language options in Control Panel, then the application accesses a different property. For example, in a sequence like this, CurrencyGroupSeparator can be accessed. Then the user can change patterns in the Control Panel, and CurrencyDecimalSeparator, when accessed, follows the new settings. A similar inconsistency occurs when the user changes the user culture in the Control Panel.
In .NET Framework version 2.0 and later, does not use this "lazy initialization." Instead, it reads all user-overridable properties when it is created. There is still a small window of vulnerability in which neither object creation nor the user override process is atomic, and the relevant values can change during object creation. However, the occurrence of this vulnerability is extremely rare.
Numeric values are formatted using standard or custom patterns stored in the properties of a . To modify the display of a value, the application must make the object writable so that custom patterns can be saved in its properties.
The following table describes the format patterns for each standard format specifier and the associated properties that can be set to modify the standard formats. For details about the use of these patterns, see Standard Numeric Format Strings.
Description and associated properties
Associated properties: NegativeSign
Scientific (exponential) format.
A object can be created only for the invariant culture or for specific cultures, not for neutral cultures. For more information about the invariant culture, specific cultures, and neutral cultures, see the CultureInfo class.
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.