Example usage for java.text DecimalFormat getGroupingSize

List of usage examples for java.text DecimalFormat getGroupingSize

Introduction

In this page you can find the example usage for java.text DecimalFormat getGroupingSize.

Prototype

public int getGroupingSize() 

Source Link

Document

Return the grouping size.

Usage

From source file:Main.java

public static void main(String[] argv) throws Exception {
    DecimalFormat format = new DecimalFormat();

    System.out.println(format.getGroupingSize());

}

From source file:org.mozilla.gecko.GeckoAppShell.java

private static void putLocaleEnv() {
    GeckoAppShell.putenv("LANG=" + Locale.getDefault().toString());
    NumberFormat nf = NumberFormat.getInstance();
    if (nf instanceof DecimalFormat) {
        DecimalFormat df = (DecimalFormat) nf;
        DecimalFormatSymbols dfs = df.getDecimalFormatSymbols();

        GeckoAppShell.putenv("LOCALE_DECIMAL_POINT=" + dfs.getDecimalSeparator());
        GeckoAppShell.putenv("LOCALE_THOUSANDS_SEP=" + dfs.getGroupingSeparator());
        GeckoAppShell.putenv("LOCALE_GROUPING=" + (char) df.getGroupingSize());
    }// w  w  w .  j  ava 2 s  .c  o  m
}