Post Reply 
"Digit Grouping" is messed up
01-01-2022, 07:24 AM
Post: #7
RE: "Digit Grouping" is bull shit
Quote:Does the localization mentioned in the link simply change the input/output formats, or does it allow the source code itself to use the localizations?

You ask in the program code in which language your computer is configured and what should then be done depending on the system language actually set. The javac compiler checks in which language your computer is configured. The settings for the number separator are then actually taken into account. The input format itself is then not changed, the program can deal with the format if this format has been made known through localization.

Code:

    double d = 1.2345;
    Locale locde = new Locale("de", "DE");
    Locale locus = new Locale("en", "US");
    System.out.format(locde, "%.3f\n", d); // 1,235
    System.out.format(locus, "%.3f\n", d); // 1.235
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
"Digit Grouping" is messed up - Roland - 12-31-2021, 03:34 PM
RE: "Digit Grouping" is bull shit - Roland - 12-31-2021, 05:32 PM
RE: "Digit Grouping" is bull shit - Roland - 12-31-2021, 05:34 PM
RE: "Digit Grouping" is bull shit - Roland - 01-01-2022 07:24 AM
RE: "Digit Grouping" is messed up - Roland - 01-02-2022, 08:55 AM
RE: "Digit Grouping" is messed up - Roland - 01-02-2022, 09:07 AM



User(s) browsing this thread: 2 Guest(s)