This documentation is archived and is not being maintained.

NumberFormatInfo.DigitSubstitution Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets a value that specifies how the graphical user interface displays the shape of a digit.

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

[ComVisibleAttribute(false)] 
public:
property DigitShapes DigitSubstitution {
	DigitShapes get ();
	void set (DigitShapes value);
}
/** @property */
public DigitShapes get_DigitSubstitution ()

/** @property */
public void set_DigitSubstitution (DigitShapes value)

public function get DigitSubstitution () : DigitShapes

public function set DigitSubstitution (value : DigitShapes)

Property Value

One of the DigitShapes values.

Exception typeCondition

InvalidOperationException

The current NumberFormatInfo object is read-only.

ArgumentException

The value in a set operation is not a defined DigitShapes value.

The following code example demonstrates the DigitSubstitution property.

// This example demonstrates the
// System.Globalization.NumberFormatInfo.DigitSubstitution property.

using namespace System;
using namespace System::Globalization;

int main()
{
    CultureInfo^ westernCI = gcnew CultureInfo("en-US");
    CultureInfo^ arabicCI  = gcnew CultureInfo("ar-SA");
    CultureInfo^ thaiCI    = gcnew CultureInfo("th-TH");
    DigitShapes shape;
    String^ name;
    String^ intro = "The digit substitution value for " +
        "the {0} culture is {1}.";

    // Western culture.
    name  = westernCI->EnglishName;
    shape = westernCI->NumberFormat->DigitSubstitution;
    Console::WriteLine(intro, name, shape);

    // Arabic culture.
    name  = arabicCI->EnglishName;
    shape = arabicCI->NumberFormat->DigitSubstitution;
    Console::WriteLine(intro, name, shape);

    // Thai culture.
    name  = thaiCI->EnglishName;
    shape = thaiCI->NumberFormat->DigitSubstitution;
    Console::WriteLine(intro, name, shape);
}

/*
This code example produces the following results:

The digit substitution value for the English (United States) culture is None.
The digit substitution value for the Arabic (Saudi Arabia) culture is Context.
The digit substitution value for the Thai (Thailand) culture is None.

*/

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0
Show: