• Post Reply Bookmark Topic Watch Topic
  • New Topic

Formatting a numeric value (123,456)  RSS feed

 
Donald Nunn
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, fellow ranchers. Is there a class or a method provided that will format a numeric value from 123456 to 123,456?
Thanks,
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup - java.text.DecimalFormat.
 
Donald Nunn
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!