@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)); }
@Test public void safeInt() { Assert.assertEquals(1, NumberUtils.safeInt("200000.00", 1)); Assert.assertEquals(200000, NumberUtils.safeInt("200000", 200000)); }