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