FileDocCategorySizeDatePackage
NumFormatTest.javaAPI DocExample989Sat Nov 25 12:56:04 GMT 2000None

NumFormatTest

public class NumFormatTest extends Object

Fields Summary
public static final double
intlNumber
A number to format
public static final double
ourNumber
Another number to format
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] av)
The main (and only) method in this class.

	//-

	         
	      

		//+
		NumberFormat defForm = NumberFormat.getInstance();
		NumberFormat ourForm = new DecimalFormat("##0.##");
		// toPattern() will reveal the combination of #0., etc
		// that this particular local uses to format with!
		System.out.println("defForm's pattern is " +
			((DecimalFormat)defForm).toPattern());
		System.out.println(intlNumber + " formats as " +
			defForm.format(intlNumber));
		System.out.println(ourNumber + " formats as " +
			ourForm.format(ourNumber));
		System.out.println(ourNumber + " formats as " +
			defForm.format(ourNumber) + " using the default format");
		//-