Format number

HI, Please helpHow can I format following number exmpl 34540 to have displayed34,540 this is not decimal number its just 34thousand 5 hundred etcThxAYMF
[194 byte] By [AsYourMindFliesa] at [2007-11-27 6:12:42]
# 1
see java.text.NumberFormatmyString = NumberFormat.getInstance().format(myNumber);
j_shadinataa at 2007-7-12 17:20:10 > top of Java-index,Java Essentials,New To Java...
# 2
Or with String.format() or the PrintStream/PrintWriter/etc printf() methods using the format string "%,d". According to the documentation for Formatter ( http://java.sun.com/javase/6/docs/api/java/util/Formatter.html) the comma "will include locale-specific grouping separators".
pbrockway2a at 2007-7-12 17:20:10 > top of Java-index,Java Essentials,New To Java...
# 3
Tks,AYMF
AsYourMindFliesa at 2007-7-12 17:20:10 > top of Java-index,Java Essentials,New To Java...