package p36_lokalizacja.formatowanie;

import java.text.DecimalFormat;

public class TestDecimalFormat {

	public static void main(String[] args) {
		double number = 123456.45;
		DecimalFormat df1 = new DecimalFormat();
		
		//df1.setDecimalFormatSymbols(DecimalFormatSymbols.getInstance(new Locale("pl")));
		System.out.println(df1.format(number));

		df1.applyPattern("00000.000");
		System.out.println(df1.format(number));

		df1.applyLocalizedPattern("00000,000");
		System.out.println(df1.format(number));

		df1.applyPattern("#.0#");
		System.out.println(df1.format(number));
		
		DecimalFormat df2 = new DecimalFormat("##,##.#");
		System.out.println(df2.format(number));
	}

}
