FileDocCategorySizeDatePackage
NumFormat2.javaAPI DocExample676Sat Nov 25 12:56:04 GMT 2000None

NumFormat2

public class NumFormat2 extends Object

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


	         
	      
		// Get a format instance
		NumberFormat form = NumberFormat.getInstance();

		// Set it to look like 999.99[99]
		form.setMinimumIntegerDigits(3);
		form.setMinimumFractionDigits(2);
		form.setMaximumFractionDigits(4);

		// Now print using it.
		for (int i=0; i<data.length; i++)
			System.out.println(data[i] + "\tformats as " +
				form.format(data[i]));