// use number format formatted data import java.text. *; import java.util. *;
public class IntegerSample {public static void main (String args []) {int amount = 54321; NumberFormat myformat = NumberFormat.getInstance (); // system format System.out.println (myformat.format (amount)); NumberFormat usformat = NumberFormat.getIntegerInstance (Locale.US); // use format System.out.println (usformat.format (amount)); NumberFormat germanformat = NumberFormat.getInstance (Locale.CHINA); // china format System.out.println (germanformat .format (Amount); Numberformat Jaformat = NumberFormat.GetInstance (locale.japan); // japan format system.out.println (jaformat.format (amount));}
}
// --------------------------------- //
operation result:
F: / 2004-04-12> Java integersample54, 32154, 32154, 32154, 321