The following example shows the effect of the different patterns.
import tango.io.Print, tango.text.locale.Common; void main() { NumberFormat fmt = new NumberFormat; int n = -5678; // Display the default pattern. Println(Formatter.format(fmt, "{0:N}", n)); // Display all patterns. for (int i = 0; i <= 4; i++) { fmt.numberNegativePattern = i; Println(Formatter.format(fmt, "{0:N}", n)); } } // Produces the following output: // (5,678.00) // (5,678.00) // -5,678.00 // - 5,678.00 // 5,678.00- // 5,678.00 -
Property. Assigns the format pattern for negative numbers.