mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
public class ConvertToNumberTest {
|
||||
@@ -31,4 +32,13 @@ public class ConvertToNumberTest {
|
||||
assert date != null;
|
||||
Assert.assertEquals(date.getTime(), dateLong.longValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void toBigDecimalTest(){
|
||||
BigDecimal bigDecimal = Convert.toBigDecimal("1.1f");
|
||||
Assert.assertEquals(1.1f, bigDecimal.floatValue(), 1);
|
||||
|
||||
bigDecimal = Convert.toBigDecimal("1L");
|
||||
Assert.assertEquals(1L, bigDecimal.longValue());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user