Example usage for java.util Locale CANADA

List of usage examples for java.util Locale CANADA

Introduction

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

Prototype

Locale CANADA

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

Click Source Link

Document

Useful constant for country.

Usage

From source file:Main.java

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

    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) {

    Calendar cal = Calendar.getInstance(Locale.CANADA);

    // print the date for canada 
    System.out.println("Date And Time in Canada Is: " + cal.getTime());
}

From source file:Main.java

public static void main(String[] argv) throws Exception {

    // Format//from   ww w. j  a  v a 2s  .  c o m
    Locale locale = Locale.CANADA;
    String string = NumberFormat.getPercentInstance(locale).format(123.45);

}

From source file:Main.java

  public static void main(String[] argv) throws Exception {

  Locale locale = Locale.CANADA;
  String string = NumberFormat.getNumberInstance(locale).format(-1234.56); 
  System.out.println(string);/*from  ww w . j  a  v a 2s  .  c  o m*/

}

From source file:Main.java

public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getInstance(Locale.CANADA);
    System.out.println(numberFormat.getMaximumFractionDigits());
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getNumberInstance(Locale.CANADA);
    System.out.println(numberFormat.getMaximumFractionDigits());
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getPercentInstance(Locale.CANADA);
    System.out.println(numberFormat.getRoundingMode());
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getPercentInstance(Locale.CANADA);
    System.out.println(numberFormat.hashCode());
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getPercentInstance(Locale.CANADA);
    System.out.println(numberFormat.isParseIntegerOnly());
}

From source file:Main.java

public static void main(String[] args) throws Exception {
    NumberFormat numberFormat = NumberFormat.getIntegerInstance(Locale.CANADA);
    System.out.println(numberFormat.getMaximumFractionDigits());
}