@@ -191,14 +191,14 @@ public static String shortCount(@NonNull final Context context, final long count
191191
192192 final double value = (double ) count ;
193193 if (count >= 1000000000 ) {
194- return localizeNumber ( round ( value / 1000000000 ))
195- + context . getString ( R . string . short_billion );
194+ return context . getString ( R . string . short_billion ,
195+ localizeNumber ( round ( value / 1000000000 )) );
196196 } else if (count >= 1000000 ) {
197- return localizeNumber ( round ( value / 1000000 ))
198- + context . getString ( R . string . short_million );
197+ return context . getString ( R . string . short_million ,
198+ localizeNumber ( round ( value / 1000000 )) );
199199 } else if (count >= 1000 ) {
200- return localizeNumber ( round ( value / 1000 ))
201- + context . getString ( R . string . short_thousand );
200+ return context . getString ( R . string . short_thousand ,
201+ localizeNumber ( round ( value / 1000 , 0 )) );
202202 } else {
203203 return localizeNumber (value );
204204 }
@@ -417,7 +417,11 @@ private static Locale getLocaleFromPrefs(@NonNull final Context context,
417417 }
418418
419419 private static double round (final double value ) {
420- return new BigDecimal (value ).setScale (1 , RoundingMode .HALF_UP ).doubleValue ();
420+ return round (value , 1 );
421+ }
422+
423+ private static double round (final double value , final int scale ) {
424+ return new BigDecimal (value ).setScale (scale , RoundingMode .HALF_UP ).doubleValue ();
421425 }
422426
423427 private static String getQuantity (@ NonNull final Context context ,
0 commit comments