This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Formatting a numeric value (123,456) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Formatting a numeric value (123,456)" Watch "Formatting a numeric value (123,456)" New topic
Author

Formatting a numeric value (123,456)

Donald Nunn
Ranch Hand

Joined: Nov 11, 2000
Posts: 200
Hello, fellow ranchers. Is there a class or a method provided that will format a numeric value from 123456 to 123,456?
Thanks,


<b>Donald Nunn</b><br />Sun Certified Programmer for the Java 2 Platform
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Yup - java.text.DecimalFormat.


"I'm not back." - Bill Harding, Twister
Donald Nunn
Ranch Hand

Joined: Nov 11, 2000
Posts: 200
Thanks, Jim for that great suggestion. I did get it to work and it looks great. Thanks, again.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Formatting a numeric value (123,456)
 
Similar Threads
Enumerating Letters (a=1,b=2..)
regarding NumberFormat class.
Regarding Files Names
Virtual Keys
Deciphering the instructions