Skip to main content
NumberSubstitution Class
 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Specifies how numbers in text are displayed in different cultures.

Namespace:   System.Windows.Media
Assembly:  PresentationCore (in PresentationCore.dll)

SystemObject
  System.Windows.MediaNumberSubstitution

public class NumberSubstitution
public ref class NumberSubstitution 
type NumberSubstitution = class end
Public Class NumberSubstitution
NameDescription
System_CAPS_pubmethod NumberSubstitution

Initializes a new instance of the NumberSubstitution class.

System_CAPS_pubmethod NumberSubstitution

Initializes a new instance of the NumberSubstitution class with explicit property values.

NameDescription
System_CAPS_pubproperty

Gets or sets a value which identifies which culture to use when the value of the property is set to Override.

System_CAPS_pubproperty

Gets or sets a value which identifies the source of the culture value that is used to determine number substitution.

System_CAPS_pubproperty

Gets or sets a value which identifies the substitution method that is used to determine number substitution.

NameDescription
System_CAPS_pubmethod Equals

Determines whether the specified object is equal to the current NumberSubstitution object.(Overrides ObjectEquals.)

System_CAPS_protmethod Finalize

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethod System_CAPS_static GetCultureOverride

Returns the value of from the provided element.

System_CAPS_pubmethod System_CAPS_static GetCultureSource

Returns the value of from the provided element.

System_CAPS_pubmethod GetHashCode

Serves as a hash function for NumberSubstitution. It is suitable for use in hashing algorithms and data structures such as a hash table.(Overrides ObjectGetHashCode.)

System_CAPS_pubmethod System_CAPS_static GetSubstitution

Returns the value of from the provided element.

System_CAPS_pubmethod GetType

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethod MemberwiseClone

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethod System_CAPS_static SetCultureOverride

Sets the value of for a provided element.

System_CAPS_pubmethod System_CAPS_static SetCultureSource

Sets the value of for a provided element.

System_CAPS_pubmethod System_CAPS_static SetSubstitution

Sets the value of for a provided element.

System_CAPS_pubmethod ToString

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubfield System_CAPS_static CultureOverrideProperty

Identifies the  dependency property.

System_CAPS_pubfield System_CAPS_static CultureSourceProperty

Identifies the  dependency property.

System_CAPS_pubfield System_CAPS_static SubstitutionProperty

Identifies the  dependency property.

Most cultures use the decimal system to represent numbers, but many cultures use different digit shapes. The following table shows several numbering systems used by different cultures.

Table of number substitution glyphs

Example of the appearance of digits in different cultures

It is not sufficient to provide alternate Unicode code points for each set of digit shapes, because, unlike letters, digits are used in calculations. Every application, every operating system, and every run-time library contains code dedicated to converting an internal binary format numeric value to a string of characters, and vice versa. These conversion routines are coded to use Unicode digits "0030" through "0039".

The NumberSubstitution class provides functionality that allows different cultures to substitute the appropriate digit shapes at rendering time. This functionality is similar to the one used for providing font substitution and language dependent font rendering.

System_CAPS_noteNote

Many cultures are discarding their traditional digits shapes and adopting Western digits shapes, therefore the number substitution functionality recognizes the distinction for each culture between traditional digit shapes and national standard digit shapes.

This type is not typically used in XAML as an object element. However, the type exposes several attached properties that can be set on other object elements that have text content.

.NET Framework
Available since 3.0

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top