|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.samskivert.velocity.CurrencyTool
public class CurrencyTool
Provides handy currency functions for use in velocity.
| Field Summary | |
|---|---|
protected Locale |
_locale
The locale in which we are providing currency functionality. |
| Constructor Summary | |
|---|---|
CurrencyTool(Locale locale)
Creates a new CurrencyTool which will used the supplied request to look up the locale with which to do currency formatting in. |
|
| Method Summary | |
|---|---|
String |
currency(double value)
Converts a number representing currency in the requester's locale to a display string. |
String |
currencyPennies(double value)
Converts a number representing pennies to a currency display string. |
String |
dollars(double value)
Converts a number representing dollars to a currency display string. |
String |
dollarsPennies(double value)
Converts a number representing pennies to a displayable dollars value. |
String |
penniesToDollars(int pennies)
Velocity currently doesn't support floats, so we have to provide our own support to convert pennies to a dollar amount. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Locale _locale
| Constructor Detail |
|---|
public CurrencyTool(Locale locale)
| Method Detail |
|---|
public String dollars(double value)
public String dollarsPennies(double value)
public String currency(double value)
dollars(double).
public String currencyPennies(double value)
dollarsPennies(double).
public String penniesToDollars(int pennies)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||