• Post Reply Bookmark Topic Watch Topic
  • New Topic

formatting a value  RSS feed

 
Kingsley Mullers
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I format the amount so that it contains comma and full stop when the number increases or changes?

E.g. for 3,125.00 (three thousand one hundred and twenty five) or 1.25 or 125.00 these are all in currency but do not have to show currency value
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java.text.DecimalFormat class is your friend.



Gives "$1,234.56" in the U.S. English locale.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!