fix():格式规范修改
parent
e40d6fcfe2
commit
9a60f4e7c4
|
@ -835,8 +835,8 @@ public class Convert {
|
|||
*
|
||||
* @return 半角字符串
|
||||
*/
|
||||
public static String toDBC (String input) {
|
||||
return toDBC(input, null);
|
||||
public static String toDbc(String input) {
|
||||
return toDbc(input, null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -847,7 +847,7 @@ public class Convert {
|
|||
*
|
||||
* @return 替换后的字符
|
||||
*/
|
||||
public static String toDBC (String text, Set<Character> notConvertSet) {
|
||||
public static String toDbc(String text, Set<Character> notConvertSet) {
|
||||
char[] c = text.toCharArray();
|
||||
for (int i = 0 ; i < c.length ; i++) {
|
||||
if (null != notConvertSet && notConvertSet.contains(c[i])) {
|
||||
|
@ -857,7 +857,7 @@ public class Convert {
|
|||
|
||||
if (c[i] == '\u3000') {
|
||||
c[i] = ' ';
|
||||
} else if (c[i] > '\uFF00' && c[i] < '\uFF5F') {
|
||||
} else if (c[i] > '\uFF00' && c[i] < '⦅') {
|
||||
c[i] = (char) (c[i] - 65248);
|
||||
}
|
||||
}
|
||||
|
@ -894,12 +894,12 @@ public class Convert {
|
|||
int integerPart = (int) Math.floor(n);
|
||||
|
||||
for (int i = 0 ; i < unit[0].length && integerPart > 0 ; i++) {
|
||||
String p = "";
|
||||
StringBuilder p = new StringBuilder();
|
||||
for (int j = 0 ; j < unit[1].length && n > 0 ; j++) {
|
||||
p = digit[integerPart % 10] + unit[1][j] + p;
|
||||
p.insert(0, digit[integerPart % 10] + unit[1][j]);
|
||||
integerPart = integerPart / 10;
|
||||
}
|
||||
s.insert(0, p.replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i]);
|
||||
s.insert(0, p.toString().replaceAll("(零.)*零$", "").replaceAll("^$", "零") + unit[0][i]);
|
||||
}
|
||||
return head + s.toString().replaceAll("(零.)*零元", "元").replaceFirst("(零.)+", "").replaceAll("(零.)+", "零").replaceAll("^整$", "零元整");
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue