NumberFormatInfo.CurrencyDecimalDigits Indicates the number of decimal places to use in currency values. : NumberFormatInfo « Data Types « C# / C Sharp






NumberFormatInfo.CurrencyDecimalDigits Indicates the number of decimal places to use in currency values.

 

using System;
using System.Globalization;

class NumberFormatInfoSample {
   public static void Main() {
      NumberFormatInfo nfi = new CultureInfo( "en-US", false ).NumberFormat;
      Int64 myInt = -1234;
      Console.WriteLine( myInt.ToString( "C", nfi ) );
      nfi.CurrencyDecimalDigits = 4;
      Console.WriteLine( myInt.ToString( "C", nfi ) );

   }
}

//($1,234.00)
//($1,234.0000)

   
  








Related examples in the same category

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