NumberFormatInfo.Number Negative Pattern : NumberFormatInfo « Data Types « C# / C Sharp






NumberFormatInfo.Number Negative Pattern

 

 using System;
 using System.Globalization;
 class SamplesNumberFormatInfo  {

    public static void Main()  {
       NumberFormatInfo myNfi = new NumberFormatInfo();
       Int64 myInt = -1234;
       Console.WriteLine( "Default  :{0}", myInt.ToString( "N", myNfi ) );
       for ( int i = 0; i <= 4; i++ )  {
          myNfi.NumberNegativePattern = i;
          Console.WriteLine( "Pattern {0}:{1}", myNfi.NumberNegativePattern, myInt.ToString( "N", myNfi ) );
       }
    }
 }
/*
Default  :-1,234.00
Pattern 0:(1,234.00)
Pattern 1:-1,234.00
Pattern 2:- 1,234.00
Pattern 3:1,234.00-
Pattern 4:1,234.00 -


*/

   
  








Related examples in the same category

1.NumberFormatInfo Defines how numeric values are formatted and displayed, depending on the culture.
2.NumberFormatInfo.CurrencyDecimalDigits Indicates the number of decimal places to use in currency values.
3.NumberFormatInfo.Currency Decimal Separator
4.NumberFormatInfo.Currency Group Separator
5.NumberFormatInfo.Currency Group Sizes
6.NumberFormatInfo.Currency Symbol
7.NumberFormatInfo.Digit Substitution
8.NumberFormatInfo properties: Currency
9.NumberFormatInfo properties: Number
10.NumberFormatInfo properties: Percent
11.NumberFormatInfo.Native Digits
12.NumberFormatInfo.Number Decimal Digits
13.NumberFormatInfo.Number Decimal Separator
14.NumberFormatInfo.Number Group Separator Property
15.NumberFormatInfo.Number Group Sizes
16.Displays the value with three elements in the GroupSize array.
17.Displays the value with zero as the last element in the GroupSize array.
18.NumberFormatInfo.Percent Decimal Digits
19.NumberFormatInfo.Percent Decimal Separator
20.NumberFormatInfo.Percent Group Separator
21.NumberFormatInfo.Percent Group Sizes