mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
修复:格式化为中文日期时,0被处理为空串
This commit is contained in:
@@ -164,6 +164,11 @@ public class NumberChineseFormatter {
|
||||
*/
|
||||
public static String formatThousand(int amount, boolean isUseTraditional){
|
||||
Assert.checkBetween(amount, -999, 999, "Number support only: (-999 ~ 999)!");
|
||||
|
||||
// thousandToChinese方法对0不处理,此处直接返回"零"
|
||||
if (amount == 0) {
|
||||
return String.valueOf(DIGITS[0]);
|
||||
}
|
||||
final String chinese = thousandToChinese(amount, isUseTraditional);
|
||||
if(amount < 20 && amount > 10){
|
||||
// "十一"而非"一十一"
|
||||
|
Reference in New Issue
Block a user