Find out Native Digits for number format in CSharp

Description

The following code shows how to find out Native Digits for number format.

Example


using System;//from w  w  w.  j av a2s  .co  m
using System.Globalization;
using System.Threading;

class Sample 
{
    public static void Main() 
    {
        CultureInfo currentCI = Thread.CurrentThread.CurrentCulture;
        NumberFormatInfo nfi = currentCI.NumberFormat;
        string[] nativeDigitList = nfi.NativeDigits;
    
        Console.WriteLine("The native digits for the {0} culture are:", currentCI.Name);
        foreach (string s in nativeDigitList)
        {
            Console.Write("\"{0}\" ", s);
        }
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Data Types »




C# Data Types
Bool
Byte
Char
Decimal
Double
Float
Integer
Long
Short
String
C# Array
Array Example
Byte Array
C# Standard Data Type Format
BigInteger
Complex
Currency
DateTime
DateTimeOffset
DateTime Format Parse Convert
TimeSpan
TimeZone
Enum
Null
tuple
var