Name: rmT116609 Date: 05/24/2004
A DESCRIPTION OF THE REQUEST :
printf lacks support for printing localized currency values. Right now, you cannot use printf to print a table of currency values such as this one: (_ is a space)
___$1.23
$1,234.56
Printing $%,8.2f would put the $ outside the padding. And, at any rate, you don't want to hard-wire the locale-dependent $ into the format string.
JUSTIFICATION :
It would extend printing of currency values to printf. Right now, printf handles dates and times, just like MessageFormat does, but MessageFormat or NumberFormat is still required for currencies. Developers need to learn two APIs with very different flavors.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Pick an unused format code for currencies, say "q".
printf("%10q", amount) would print a currency value in a field of width 10, using the currency format of the current locale
CUSTOMER SUBMITTED WORKAROUND :
Use NumberFormat.getCurrencyInstance
(Incident Review ID: 270800)
======================================================================