
import java.text.*;
import java.util.*;

class NumberFormatExample {

    public void numberFormat(Locale currentLocale) {
        Integer intNum = new Integer(123456789);
        Double doubleNum = new Double(1234.1234);

        String intNumOut, doubleNumOut;

        NumberFormat numberFormatter = NumberFormat.getNumberInstance(currentLocale);
        intNumOut = numberFormatter.format(intNum);
        doubleNumOut = numberFormatter.format(doubleNum);

        System.out.println();
        System.out.println("Integer num : " + intNumOut + "   " + currentLocale.toString());
        System.out.println("Double  num : " + doubleNumOut + "   " + currentLocale.toString());
    }

    public static void main(String args[]) {
        Locale[] locales = new Locale[]{new Locale("fr", "FR"), new Locale("de", "DE"),
            new Locale("ca", "CA"),new Locale("rs", "RS"),new Locale("en", "IN")
        };

        NumberFormatExample[] formate = new NumberFormatExample[locales.length];

        for (int i = 0; i < locales.length; i++) {
            formate[i] = new NumberFormatExample();
            formate[i].numberFormat(locales[i]);

        }
    }
}
