Back to project page android-socialbuttons.
The source code is released under:
Apache License
If you think the Android project android-socialbuttons listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package it.gcacace.android.socialbuttons; //from w ww .ja v a2 s.co m import java.text.DecimalFormat; import android.content.Context; public class UIUtils { public static String numberToShortenedString(Context context, Long num) { if(num < 1000) return num.toString(); String format = "###,###.#"; if(num > 9999) { format = "###,###"; } DecimalFormat oneDForm = new DecimalFormat(format); return oneDForm.format((double) num/1000) + context.getResources().getString(R.string.fb_like_thousands); } }