diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a2b2a531..7bee3607d 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ * 【core 】 修复PostgreSQL、H2使用upsert字段大小写问题(issue#I8PB4X@Gitee) * 【core 】 修复RandomUtil.randomInt,RandomUtil.randomLong边界问题(pr#3450@Github) * 【db 】 修复Druid连接池无法设置部分属性问题(issue#I8STFC@Gitee) +* 【core 】 修复金额转换为英文时缺少 trillion 单位问题(pr#3454@Github) ------------------------------------------------------------------------------------------------------------- # 5.8.24(2023-12-23) diff --git a/hutool-core/src/test/java/cn/hutool/core/convert/NumberWordFormatTest.java b/hutool-core/src/test/java/cn/hutool/core/convert/NumberWordFormatTest.java index 07d7e1563..47135706a 100644 --- a/hutool-core/src/test/java/cn/hutool/core/convert/NumberWordFormatTest.java +++ b/hutool-core/src/test/java/cn/hutool/core/convert/NumberWordFormatTest.java @@ -7,31 +7,31 @@ public class NumberWordFormatTest { @Test public void formatTest() { - String format = NumberWordFormatter.format(100.23); + final String format = NumberWordFormatter.format(100.23); Assert.assertEquals("ONE HUNDRED AND CENTS TWENTY THREE ONLY", format); - String format2 = NumberWordFormatter.format("2100.00"); + final String format2 = NumberWordFormatter.format("2100.00"); Assert.assertEquals("TWO THOUSAND ONE HUNDRED AND CENTS ONLY", format2); - String format3 = NumberWordFormatter.format("1234567890123.12"); + final String format3 = NumberWordFormatter.format("1234567890123.12"); Assert.assertEquals("ONE TRILLION TWO HUNDRED AND THIRTY FOUR BILLION FIVE HUNDRED AND SIXTY SEVEN MILLION EIGHT HUNDRED AND NINETY THOUSAND ONE HUNDRED AND TWENTY THREE AND CENTS TWELVE ONLY", format3); } @Test public void formatSimpleTest() { - String format1 = NumberWordFormatter.formatSimple(1200, false); + final String format1 = NumberWordFormatter.formatSimple(1200, false); Assert.assertEquals("1.2k", format1); - String format2 = NumberWordFormatter.formatSimple(4384324, false); + final String format2 = NumberWordFormatter.formatSimple(4384324, false); Assert.assertEquals("4.38m", format2); - String format3 = NumberWordFormatter.formatSimple(4384324, true); + final String format3 = NumberWordFormatter.formatSimple(4384324, true); Assert.assertEquals("438.43w", format3); - String format4 = NumberWordFormatter.formatSimple(4384324); + final String format4 = NumberWordFormatter.formatSimple(4384324); Assert.assertEquals("438.43w", format4); - String format5 = NumberWordFormatter.formatSimple(438); + final String format5 = NumberWordFormatter.formatSimple(438); Assert.assertEquals("438", format5); }