2

Does android provide a way to shrink or abbreviate large numbers or do I have to roll out my own? For examples

  • 1,000 => 1k
  • 25,678 => 25.7k
  • 3,456,245 => 3.5m

Or at the very least, is there a built-in android/java method for adding commas to numbers?

The reason I would really rather not roll this out myself is because this is for an android app, and I need the app itself to take locale into account.

learner
  • 11,490
  • 26
  • 97
  • 169
  • 2
    Have you seen `NumberFormat`. Here is [doc](http://developer.android.com/reference/java/text/NumberFormat.html) – JavaGhost Oct 22 '15 at 17:31
  • 3
    Take a look at this [SO post](http://stackoverflow.com/questions/4753251/how-to-go-about-formatting-1200-to-1-2k-in-java). – Dhaval Patel Oct 22 '15 at 17:34
  • Thank you so much. I looked but didn't find it. Sorry for the duplicate question. – learner Oct 22 '15 at 17:39

0 Answers0