This commit is contained in:
Looly 2022-01-19 09:25:05 +08:00
parent ee80e8c195
commit 9a88945386
3 changed files with 8 additions and 6 deletions

View File

@ -3,7 +3,7 @@
-------------------------------------------------------------------------------------------------------------
# 5.7.20 (2022-01-17)
# 5.7.20 (2022-01-19)
### 🐣新特性
* 【core 】 增加对null值友好的groupingBy操作的Collector实现可指定map类型pr#498@Gitee
@ -26,6 +26,7 @@
* 【core 】 修复PathUtil.moveContent移动覆盖导致的问题issue#I4QV0L@Gitee
* 【core 】 修复Opt.ofTry中并发环境下线程安全问题pr#504@Gitee
* 【core 】 修复PatternFinder中end边界判断问题issue#2099@Github
* 【core 】 修复格式化为中文日期时0被处理为空串pr#507@Gitee
-------------------------------------------------------------------------------------------------------------
# 5.7.19 (2022-01-07)

View File

@ -165,10 +165,6 @@ 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){
// "十一"而非"一十一"
@ -289,6 +285,11 @@ public class NumberChineseFormatter {
* @return 转换后的汉字
*/
private static String thousandToChinese(int amountPart, boolean isUseTraditional) {
if (amountPart == 0) {
// issue#I4R92H@Gitee
return String.valueOf(DIGITS[0]);
}
int temp = amountPart;
StringBuilder chineseStr = new StringBuilder();

View File

@ -555,7 +555,7 @@ public class CalendarUtil {
result.append(NumberChineseFormatter.formatThousand(day, false));
result.append('日');
// 时分秒中零不需要替换
// 只替换年月日时分秒中零不需要替换
String temp = result.toString().replace('零', '');
result.delete(0, result.length());
result.append(temp);