For USD, the currency symbol will be based on the locale of the request. For the "en_US" locale, the result is "$123.45" and for "fi_FI" locale, the formatting is "123,45 USD". The formatting rules come from the Currency class.

Description

Attributes

number (required) - The number object to formate

format (optional) - The formatting pattern to use for the number, see DecimalFormat

formatName (optional) - Look up format from the default MessageSource / ResourceBundle (i18n/.properties file) with this key. Look up format from the default MessageSource / ResourceBundle (i18n/.properties file) with this key. If format and formatName are empty, format is looked up with 'default.number.format' key. If the key is missing, '0' formatting pattern is used.

type (optional) - The type of formatter to use: 'number', 'currency' or 'percent' . format or formatName aren't used when type is specified.

currencySymbol (optional) - Force the currency symbol to some symbol, recommended way is to use currencyCode attribute instead (takes symbol information from Currency)

roundingMode (optional) - Sets the RoundingMode used in this DecimalFormat. Usual values: HALF_UP, HALF_DOWN. If roundingMode is UNNECESSARY and an ArithemeticException occurs, the original number formatted with default number formatting will be returned.

Copies of this document may be made for your own use and for distribution to others, provided that you do not charge any fee for such copies and further provided that each copy contains this Copyright Notice, whether distributed in print or electronically.
Sponsored by SpringSource