mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
修复NumberChineseFormatter.format
中自定义单位在0时错误问题(issue#3888@Github)
This commit is contained in:
parent
d7b4836157
commit
bb4491b48e
@ -195,7 +195,7 @@ public class ChineseNumberFormatter {
|
||||
*/
|
||||
public String format(double amount) {
|
||||
if (0 == amount) {
|
||||
return this.moneyMode ? "零元整" : "零";
|
||||
return this.moneyMode ? "零" + unitName + "整" : "零";
|
||||
}
|
||||
Assert.checkBetween(amount, -99_9999_9999_9999.99, 99_9999_9999_9999.99,
|
||||
"Number support only: (-99999999999999.99 ~ 99999999999999.99)!");
|
||||
|
Loading…
x
Reference in New Issue
Block a user