mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix bug
This commit is contained in:
parent
ee80e8c195
commit
9a88945386
@ -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)
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user