diff --git a/app/src/main/java/awais/instagrabber/customviews/FormattedNumberTextView.java b/app/src/main/java/awais/instagrabber/customviews/FormattedNumberTextView.java index 06cdbf93..c4b9ef60 100644 --- a/app/src/main/java/awais/instagrabber/customviews/FormattedNumberTextView.java +++ b/app/src/main/java/awais/instagrabber/customviews/FormattedNumberTextView.java @@ -13,6 +13,8 @@ import androidx.transition.Transition; import androidx.transition.TransitionManager; import androidx.transition.TransitionSet; +import java.text.DecimalFormat; +import java.text.NumberFormat; import java.time.Duration; import awais.instagrabber.customviews.helpers.ChangeText; @@ -156,10 +158,15 @@ public class FormattedNumberTextView extends AppCompatTextView { setText(NumberUtils.abbreviate(number, null)); return; } - setText(String.valueOf(number)); + setText(numberFormatter(number)); if (autoToggleToAbbreviation) { getHandler().postDelayed(() -> setShowAbbreviation(true), autoToggleTimeoutMs); } }); } + + private String numberFormatter(long number){ + DecimalFormat decimalFormat = new DecimalFormat("###,###"); + return decimalFormat.format(number); + } }