Example usage for java.util Locale FRANCE

List of usage examples for java.util Locale FRANCE

Introduction

In this page you can find the example usage for java.util Locale FRANCE.

Prototype

Locale FRANCE

To view the source code for java.util Locale FRANCE.

Click Source Link

Document

Useful constant for country.

Usage

From source file:Main.java

public static void main(String[] args) {
    Locale locale = Locale.FRANCE;

    System.out.println("Locale1:" + locale);

    // print the country of this locale
    System.out.println("Country:" + locale.getCountry());

}

From source file:Main.java

public static void main(String[] args) {
    Currency currency = Currency.getInstance(Locale.FRANCE);
    System.out.println("France: " + currency.getSymbol());

}

From source file:Main.java

public static void main(String[] args) {
    String timeStamp = new SimpleDateFormat("EEE MMM dd hh:mm:ss yyyy", Locale.FRANCE).format(new Date());
    System.out.println(timeStamp);

}

From source file:Main.java

public static void main(String args[]) {

    String s1 = "";
    String s2 = "f";

    Collator frCollator = Collator.getInstance(Locale.FRANCE);
    frCollator.setStrength(Collator.CANONICAL_DECOMPOSITION);
    if (frCollator.compare(s1, s2) < 0) {
        System.out.println("s1 < s2");
    }//  w  w  w .  jav a 2 s.  c  o m
}

From source file:Main.java

public static void main(String[] args) {

    Locale defaultLocale = Locale.getDefault();
    Locale france = Locale.FRANCE;

    System.out.printf("%s%n", DayOfWeek.MONDAY.minus(401).getDisplayName(TextStyle.SHORT, defaultLocale));
    System.out.printf("%s%n", DayOfWeek.MONDAY.minus(401).getDisplayName(TextStyle.SHORT, france));

}

From source file:Main.java

public static void main(String[] args) {
    double value = 1234567.89;

    System.out.println("Unformatted: " + value + "\n");

    Locale locales[] = { Locale.US, Locale.FRANCE, Locale.GERMANY, Locale.JAPAN, new Locale("fr", "FR", "EURO"),
            new Locale("de", "DE", "EURO") };

    for (int i = 0; i < locales.length; i++) {
        NumberFormat nf = NumberFormat.getCurrencyInstance(locales[i]);

        System.out.println("Formatted for " + locales[i] + ": " + nf.format(value));
    }//w  w w . ja va 2 s  . com
}

From source file:FormatDateLocale.java

public static void main(String[] args) {
    Locale[] locales = new Locale[] { Locale.JAPAN, Locale.CHINA, Locale.KOREA, Locale.TAIWAN, Locale.ITALY,
            Locale.FRANCE, Locale.GERMAN };

    Date today = new Date();

    for (Locale locale : locales) {
        System.out.println("Date format in " + locale.getDisplayName() + " = "
                + SimpleDateFormat.getDateInstance(SimpleDateFormat.LONG, locale).format(today).toUpperCase());
    }//from  w w  w . j  a  v  a  2s . c o  m
}

From source file:Main.java

public static void main(String[] args) {
    Date today = new Date();

    // Print date in the default locale format
    Locale defaultLocale = Locale.getDefault();
    printLocaleDetails(defaultLocale);//w w w. j  a  va2 s.  c  o  m
    printDate(defaultLocale, today);

    // Print date in French format
    printLocaleDetails(Locale.FRANCE);
    printDate(Locale.FRANCE, today);

    // Print date in German format. We could also use Locale.GERMANY
    // instead of new Locale ("de", "DE").
    Locale germanLocale = new Locale("de", "DE");
    printLocaleDetails(germanLocale);
    printDate(germanLocale, today);
}

From source file:Main.java

public static void main(String args[]) {
    Formatter fmt = new Formatter();
    Calendar cal = Calendar.getInstance();
    fmt = new Formatter();
    fmt.format("Default locale: %tc\n", cal);

    fmt.format(Locale.GERMAN, "For Locale.GERMAN: %tc\n", cal);
    fmt.format(Locale.ITALY, "For Locale.ITALY: %tc\n", cal);
    fmt.format(Locale.FRANCE, "For Locale.FRANCE: %tc\n", cal);
    System.out.println(fmt);/*ww  w  .  java 2 s .  c o m*/
}

From source file:MainClass.java

public static void main(String[] argv) {
    String pattern = "{0}K was deleted on {1}.";
    MessageFormat formatter = new MessageFormat(pattern);

    Double kb = new Double(3.5);
    Date today = new Date();
    Object[] arguments = { kb, today };

    formatter.setLocale(Locale.US);
    System.out.println(formatter.format(arguments));

    formatter.setLocale(Locale.FRANCE);
    System.out.println(formatter.format(arguments));

    pattern = "On {1}, {0}K was deleted.";
    formatter.applyPattern(pattern);/* w  ww .j av  a  2 s  . c  o m*/
    System.out.println(formatter.format(arguments));

    formatter.setLocale(Locale.US);
    System.out.println(formatter.format(arguments));
}