Meaningless Drivel is fun!*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Formatting a numeric value (123,456)" Watch "Formatting a numeric value (123,456)" New topic

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?

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

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.
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