### Question:
StackFormatter { public static String quantityToRSDecimalStack(int quantity) { String quantityStr = String.valueOf(quantity); if (quantityStr.length() <= 4) { return quantityStr; } int power = (int) Math.log10(quantity); return DECIMAL_FORMATTER.format(quantity / (Math.pow(10, (power / 3) * 3))) + SUFFIXES[power / 3]; }  static String quantityToStackSize(long quantity); static String quantityToRSStackSize(int quantity); static String quantityToRSDecimalStack(int quantity); static long stackSizeToQuantity(String string); static String formatNumber(final long number); static String formatNumber(double number);  }### Answer:
@Test public void quantityToRSDecimalStackSize() { assertEquals("0", StackFormatter.quantityToRSDecimalStack(0)); assertEquals("8500", StackFormatter.quantityToRSDecimalStack(8_500)); assertEquals("10K", StackFormatter.quantityToRSDecimalStack(10_000)); assertEquals("21.7K", StackFormatter.quantityToRSDecimalStack(21_700)); assertEquals("100K", StackFormatter.quantityToRSDecimalStack(100_000)); assertEquals("100.3K", StackFormatter.quantityToRSDecimalStack(100_300)); assertEquals("1M", StackFormatter.quantityToRSDecimalStack(1_000_000)); assertEquals("8.4M", StackFormatter.quantityToRSDecimalStack(8_450_000)); assertEquals("10M", StackFormatter.quantityToRSDecimalStack(10_000_000)); assertEquals("12.8M", StackFormatter.quantityToRSDecimalStack(12_800_000)); assertEquals("100M", StackFormatter.quantityToRSDecimalStack(100_000_000)); assertEquals("250.1M", StackFormatter.quantityToRSDecimalStack(250_100_000)); assertEquals("1B", StackFormatter.quantityToRSDecimalStack(1_000_000_000)); assertEquals("1.5B", StackFormatter.quantityToRSDecimalStack(1500_000_000)); assertEquals("2.1B", StackFormatter.quantityToRSDecimalStack(Integer.MAX_VALUE)); }