stack formatter: support larger stack sizes

This commit is contained in:
Jeremy Plsek
2018-03-18 11:33:10 -04:00
committed by Adam
parent adc5fe2b26
commit 254c62bfab
2 changed files with 10 additions and 8 deletions

View File

@@ -61,12 +61,14 @@ public class StackFormatterTest
assertEquals("100K", StackFormatter.quantityToStackSize(100_000));
assertEquals("10M", StackFormatter.quantityToStackSize(10_000_000));
assertEquals(NumberFormat.getNumberInstance().format(2.14) + "B", StackFormatter.quantityToStackSize(Integer.MAX_VALUE));
assertEquals("100B", StackFormatter.quantityToStackSize(100_000_000_000L));
assertEquals("0", StackFormatter.quantityToStackSize(-0));
assertEquals("-400", StackFormatter.quantityToStackSize(-400));
assertEquals("-400K", StackFormatter.quantityToStackSize(-400_000));
assertEquals("-40M", StackFormatter.quantityToStackSize(-40_000_000));
assertEquals(NumberFormat.getNumberInstance().format(-2.14) + "B", StackFormatter.quantityToStackSize(Integer.MIN_VALUE));
assertEquals("-400B", StackFormatter.quantityToStackSize(-400_000_000_000L));
}
@Test
@@ -103,4 +105,4 @@ public class StackFormatterTest
{
}
}
}
}