2

I have a screen in my android App that displays amounts of currency in a list. I'm using NumberFormat.getCurrencyInstance() to format the numbers, and it is working well. However, I'd like to have an effect similar to StackOverflow's representation of reputations. I.e., when there's a large value (more than x digits, probably 6), it will display with K instead of the whole value. Example:

  • $34.14 would stay the same.
  • $543,123.12 would become $543K
  • $12,512,213.54 would become $12.5M

Is there any library for this, or will I have to roll my own?

xdumaine
  • 10,096
  • 6
  • 62
  • 103
  • Take a look to this question: http://stackoverflow.com/questions/4753251/how-to-go-about-formatting-1200-to-1-2k-in-java – Vito Gentile Nov 03 '11 at 13:01

0 Answers0