All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.roguewave.examples.money.currency.v1_0.Format2

java.lang.Object
   |
   +----com.roguewave.examples.money.currency.v1_0.Format2

public class Format2
extends Object
An example of how to format a large data set of money. A sales report is generated in two different styles using the same data.

Author:
Trevor Misfeldt
See Also:
Money, MoneyFormat

Variable Index

 o sales

Constructor Index

 o Format2()

Method Index

 o main(String[])
Run program by using this command.
 o report(MoneyFormat)

Variables

 o sales
 public static final String sales[]

Constructors

 o Format2
 public Format2()

Methods

 o main
 public static void main(String args[])
Run program by using this command.

java com.roguewave.examples.money.currency.v1_0.Format2

Output should appear as follows:

 Using the default money format ... 
 Sales
 =====
 January:    4,882.98
 February:   7,023.87
 March:      12,983
 April:      19,876.01
 May:        25,873.23
 June:       14,982.21
 July:       -5,090.9
 August:     10,876.09
 September:  40,098.12
 October:    70,081.45
 November:   97,872.12
 December:   121,982.34
 Total sales for the year: 421,440.52
 Using the pattern "$#,###.00;($#,###.00)" 
 Sales
 =====
 January:    $4,882.98
 February:   $7,023.87
 March:      $12,983.00
 April:      $19,876.01
 May:        $25,873.23
 June:       $14,982.21
 July:       ($5,090.90)
 August:     $10,876.09
 September:  $40,098.12
 October:    $70,081.45
 November:   $97,872.12
 December:   $121,982.34
 Total sales for the year: $421,440.52
 

 o report
 protected static void report(MoneyFormat format)

All Packages  Class Hierarchy  This Package  Previous  Next  Index