修复NumberChineseFormatter.format中自定义单位在0时错误问题(issue#3888@Github)

This commit is contained in:
Looly 2025-03-18 19:29:31 +08:00
parent d7b4836157
commit bb4491b48e

View File

@ -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)");