• Post Reply Bookmark Topic Watch Topic
  • New Topic

percentage format  RSS feed

 
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I have a number say 488.00.I need to convert it into 4.88%.
How do I do that?
I have tried with DecimalFormat and NumberFormat.

Please help.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NumberFormat seems to work fine:
 
Marshal
Posts: 56610
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I presume you have checked the Formatter.format(), String.format(), System.out.format() and System.out.printf() methods?

CR
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!