import java.text.NumberFormat;
import java.util.Locale;
public class Main {
public static void main(String[] args) throws Exception {
NumberFormat formatter = NumberFormat.getNumberInstance(Locale.ITALY);
String number = formatter.format(123456789.12);
System.out.println("Number in Italy: " + number);
formatter = NumberFormat.getNumberInstance(Locale.JAPAN);
number = formatter.format(123456789.12);
System.out.println("Number in Japan: " + number);
}
}
|