import java.text.NumberFormat;
import java.util.Locale;
public class LocaleExample
{
	public static void main (String[] args) {
		
		double amount1=0, amount2=12.156, amount3=0.54;	
		Locale TR_Locale = new Locale ("tr", "TR");
		Locale US_Locale = new Locale ("en", "US");
		
		System.out.println ("Using Turkish locale:");	
		NumberFormat money = NumberFormat.getCurrencyInstance(TR_Locale);
		NumberFormat percent = NumberFormat.getPercentInstance(TR_Locale);
		System.out.println("amount1="+money.format(amount1));
		System.out.println("amount2="+money.format(amount2));
		System.out.println("amount3="+money.format(amount3));
		System.out.println("amount3 as percentage="+percent.format(amount3));
		
		System.out.println ("\nUsing USA locale:");
		money = NumberFormat.getCurrencyInstance(US_Locale);
		percent = NumberFormat.getPercentInstance(US_Locale);	
		System.out.println("amount1="+money.format(amount1));
		System.out.println("amount2="+money.format(amount2));
		System.out.println("amount3="+money.format(amount3));
		System.out.println("amount3 as percentage="+percent.format(amount3));
	} // main
} // LocaleExample