mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
新增AnsiColors(改自Spring Boot)、AnsiColorWrapper,优化QrCodeUtil
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package cn.hutool.core.convert;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class Issue2611Test {
|
||||
|
||||
@Test
|
||||
public void chineseMoneyToNumberTest(){
|
||||
final BigDecimal value = Convert.chineseMoneyToNumber("陆万柒仟伍佰伍拾柒元");
|
||||
|
||||
Assert.assertEquals("67,557.00", NumberUtil.decimalFormatMoney(value.doubleValue()));
|
||||
}
|
||||
}
|
@@ -1,12 +1,11 @@
|
||||
package cn.hutool.core.lang.ansi;
|
||||
|
||||
import cn.hutool.core.lang.Console;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
public class AnsiEncoderTest {
|
||||
|
||||
@@ -36,7 +35,7 @@ public class AnsiEncoderTest {
|
||||
Color backColor = new Color(255 - foreColor.getRed(), 255 - foreColor.getGreen(), 255 - foreColor.getBlue());
|
||||
AnsiElement backElement = ansiColors.findClosest(backColor).toAnsiElement(ForeOrBack.BACK);
|
||||
String encode = AnsiEncoder.encode(foreElement, backElement, text);
|
||||
//Console.print( i%2==1?encode+"\n":encode);
|
||||
Console.print( i%2==1?encode+"\n":encode);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user