On Friday, August 8, 2003, at 08:08 AM, David Thielen wrote:

Hi;

I am displaying currency in my website. It is always in U.S. dollars so I am doing:
NumberFormat.getCurrencyInstance().format( (float) price / 100f );


Two questions:
1.. I assume I should set the locale for this to en_US since I want to have the dollar sign.

If your website supports only US English, or if that's the default, then sure.


2.. Should it do the commas and periods to the user's locale - or is everyone used to dollars using the US comma/period setup.

If you're supporting other locales, I'd format accordingly. If I was selling something, I'd be as accommodating as possible. 8-)


If you're using JSP for presentation, I recommend the JSTL i18n and formatting tags instead of Java code.


david


thanks - dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to