FileDocCategorySizeDatePackage
NumberOutput.javaAPI DocExample1026Thu Feb 03 08:18:02 GMT 2000None

NumberOutput

public class NumberOutput extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

  NumberFormat form = new DecimalFormat();

      System.out.println( "Number : " + -123.496 +
                          " Formatted : " + form.format( -123.496 ) );

      System.out.println( "Number : " + 1234567890.496 +
                          " Formatted : " + form.format( 1234567890.496 ) );

      String picture = "#,###.00;(#,###.00)";
      try
      {  form = new DecimalFormat( picture );
      }
      catch( IllegalArgumentException iae )
      {  iae.printStackTrace();
         System.out.println( "Illegal picture: " + picture );
         System.exit(0);
      }
      System.out.println( "Number : " + -123.496 +
                          " Formatted : " + form.format( -123.496 ) );

      System.out.println( "Number : " + 1234567890.496 +
                          " Formatted : " + form.format( 1234567890.496 ) );