mirror of
https://gitee.com/dromara/hutool.git
synced 2025-06-28 13:34:09 +08:00
fix bug
This commit is contained in:
parent
9d563648b7
commit
3f8699f7e9
@ -8,6 +8,7 @@
|
|||||||
### 🐣新特性
|
### 🐣新特性
|
||||||
### 🐞Bug修复
|
### 🐞Bug修复
|
||||||
* 【extra 】 修复SshjSftp初始化未能代入端口配置问题(issue#2333@Github)
|
* 【extra 】 修复SshjSftp初始化未能代入端口配置问题(issue#2333@Github)
|
||||||
|
* 【core 】 修复Convert.numberToSimple转换问题(issue#2334@Github)
|
||||||
|
|
||||||
-------------------------------------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ public class NumberWordFormatter {
|
|||||||
int index = -1;
|
int index = -1;
|
||||||
double res = value;
|
double res = value;
|
||||||
while (res > 10 && (false == isTwo || index < 1)) {
|
while (res > 10 && (false == isTwo || index < 1)) {
|
||||||
if (res > 1000) {
|
if (res >= 1000) {
|
||||||
res = res / 1000;
|
res = res / 1000;
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
@ -31,4 +31,10 @@ public class NumberWordFormatTest {
|
|||||||
String format5 = NumberWordFormatter.formatSimple(438);
|
String format5 = NumberWordFormatter.formatSimple(438);
|
||||||
Assert.assertEquals("438", format5);
|
Assert.assertEquals("438", format5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void formatSimpleTest2(){
|
||||||
|
final String s = NumberWordFormatter.formatSimple(1000);
|
||||||
|
Assert.assertEquals("1k", s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user