com.samskivert.util
Class CurrencyUtil

java.lang.Object
  extended by com.samskivert.util.CurrencyUtil

public class CurrencyUtil
extends Object

Currency related utility functions.


Field Summary
protected static NumberFormat _dollarFormatter
          A number format for formatting dollars.
 
Constructor Summary
CurrencyUtil()
           
 
Method Summary
static String currency(double value, Locale locale)
          Converts a number representing currency in the specified locale to a displayable string.
protected static String currency(double value, NumberFormat nformat)
          Converts a number representing dollars to a currency display string using the supplied number format.
static String currencyPennies(double value, Locale locale)
          Converts a number representing pennies to a locale-appropriate currency display string using the supplied local.
static String dollars(double value)
          Converts a number representing dollars to a currency display string using the US locale.
static String dollarsPennies(double value)
          Converts a number representing pennies to a dollars display string using the US local.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dollarFormatter

protected static NumberFormat _dollarFormatter
A number format for formatting dollars.

Constructor Detail

CurrencyUtil

public CurrencyUtil()
Method Detail

currencyPennies

public static String currencyPennies(double value,
                                     Locale locale)
Converts a number representing pennies to a locale-appropriate currency display string using the supplied local.


currency

public static String currency(double value,
                              Locale locale)
Converts a number representing currency in the specified locale to a displayable string.


dollarsPennies

public static String dollarsPennies(double value)
Converts a number representing pennies to a dollars display string using the US local.


dollars

public static String dollars(double value)
Converts a number representing dollars to a currency display string using the US locale.


currency

protected static String currency(double value,
                                 NumberFormat nformat)
Converts a number representing dollars to a currency display string using the supplied number format.



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.