Пример #1
0
 @Test
 public void round() {
   Assert.assertEquals(1000000, NumberUtils.round(1000000, 1000000));
   Assert.assertEquals(1000000, NumberUtils.round(1000000, 100000));
   Assert.assertEquals(1000000, NumberUtils.round(1000000, 10000));
   Assert.assertEquals(1000000, NumberUtils.round(1000500, 10000));
   Assert.assertEquals(1200000, NumberUtils.round(1232342, 100000));
 }
Пример #2
0
 @Test
 public void safeInt() {
   Assert.assertEquals(1, NumberUtils.safeInt("200000.00", 1));
   Assert.assertEquals(200000, NumberUtils.safeInt("200000", 200000));
 }