formatting issues displaying currency other than locale's default

Discussion in 'Java' started by Adam Monsen, Dec 19, 2007.

  1. Adam Monsen

    Adam Monsen Guest

    ( crossposted here: http://www.javajunkies.org/index.pl?node_id=5049 )

    I'm in the en_US locale, and I want to display some amount of Euros.
    Is there some industry standard for where to place the Euro symbol,
    what thousands separator, and what decimal point character to use? And
    if so, is there something built in to Java 1.5 or greater (or in a 3rd
    party library) to produce this formatting for me?

    Using java.text.NumberFormat, I can format the monetary value 1234.56
    in Euros as follows:

    import java.text.NumberFormat;
    import java.util.Locale;

    class NFmt {
    public static void main(String args[]) {
    NumberFormat nf =
    NumberFormat.getCurrencyInstance(Locale.FRANCE);+

    String fmttt = nf.format(1234.56);
    System.out.println(fmttt);
    }
    }

    This prints 1 234,56 EURO. But someone in the USA expects money to have a
    comma for the thousands separator, a period for the decimal point, and
    the currency symbol on the left, even if they're looking at some
    amount of Euros. Right?

    This related thread comes close, but doesn't land on the solution as
    far as I can tell:
    http://groups.google.com/group/comp...read/thread/a3a32d6210a0076d/862223929125627a
    (same URL, shortened: http://tinyurl.com/3bhf5q )

    --
    Adam Monsen
     
    Adam Monsen, Dec 19, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Maurice Hulsman
    Replies:
    1
    Views:
    1,849
    Guus Bosman
    Jul 25, 2004
  2. Daniele Varrazzo

    Formatting Currency According to Locale

    Daniele Varrazzo, Apr 28, 2004, in forum: Python
    Replies:
    0
    Views:
    308
    Daniele Varrazzo
    Apr 28, 2004
  3. Travis

    ICU Locale Currency

    Travis, Dec 5, 2007, in forum: C++
    Replies:
    0
    Views:
    271
    Travis
    Dec 5, 2007
  4. Malcolm Greene
    Replies:
    0
    Views:
    292
    Malcolm Greene
    Apr 9, 2008
  5. Replies:
    4
    Views:
    1,003
Loading...

Share This Page