mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
NumberChineseFormatter提供阿拉伯转中文支持多位小数的方法
This commit is contained in:
@@ -3,6 +3,8 @@ package cn.hutool.core.convert;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class NumberChineseFormatterTest {
|
||||
|
||||
@Test
|
||||
@@ -342,4 +344,10 @@ public class NumberChineseFormatterTest {
|
||||
format = NumberChineseFormatter.format(1.02, false, false);
|
||||
Assert.assertEquals("一点零二", format);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dotTest() {
|
||||
final String format = NumberChineseFormatter.format(new BigDecimal("3.1415926"), false, false);
|
||||
Assert.assertEquals("三点一四一五九二六", format);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user