/**
* 根据数字得到汉字
*
* @param ref
* 两位数的数字
* @return
*/
public String getten(String ref) {
String returnString = "";
char[] arry = ref.toCharArray();
String ten = "十";
if (arry[0] == '0') {
returnString = getDAXie(arry[1]);
} else if (arry[0] == '1') {
if (arry[1] == '0') {
returnString = ten;
} else {
returnString = ten + getDAXie(arry[1]);
}
} else {
if (arry[1] == '0') {
returnString = getDAXie(arry[0]) + ten;
} else {
returnString = getDAXie(arry[0]) + ten + getDAXie(arry[1]);
}
}
return returnString;
}
/**
* 根据时间得到文字
*
* @param a
* @return
*/
private String getDAXie(char a) {
String returnString = "";
String returnStringe = "";
switch (a) {
case '0':
returnString = "零";
returnStringe = "零";
break;
case '1':
returnString = "壹";
returnStringe = "一";
break;
case '2':
returnString = "贰";
returnStringe = "二";
break;
case '3':
returnString = "叁";
returnStringe = "三";
break;
case '4':
returnString = "肆";
returnStringe = "四";
break;
case '5':
returnString = "伍";
returnStringe = "五";
break;
case '6':
returnString = "陆";
returnStringe = "六";
break;
case '7':
returnString = "柒";
returnStringe = "七";
break;
case '8':
returnString = "扒";
returnStringe = "八";
break;
case '9':
returnString = "玖";
returnStringe = "九";
break;
default:
break;
}
return returnStringe;
}
* 根据数字得到汉字
*
* @param ref
* 两位数的数字
* @return
*/
public String getten(String ref) {
String returnString = "";
char[] arry = ref.toCharArray();
String ten = "十";
if (arry[0] == '0') {
returnString = getDAXie(arry[1]);
} else if (arry[0] == '1') {
if (arry[1] == '0') {
returnString = ten;
} else {
returnString = ten + getDAXie(arry[1]);
}
} else {
if (arry[1] == '0') {
returnString = getDAXie(arry[0]) + ten;
} else {
returnString = getDAXie(arry[0]) + ten + getDAXie(arry[1]);
}
}
return returnString;
}
/**
* 根据时间得到文字
*
* @param a
* @return
*/
private String getDAXie(char a) {
String returnString = "";
String returnStringe = "";
switch (a) {
case '0':
returnString = "零";
returnStringe = "零";
break;
case '1':
returnString = "壹";
returnStringe = "一";
break;
case '2':
returnString = "贰";
returnStringe = "二";
break;
case '3':
returnString = "叁";
returnStringe = "三";
break;
case '4':
returnString = "肆";
returnStringe = "四";
break;
case '5':
returnString = "伍";
returnStringe = "五";
break;
case '6':
returnString = "陆";
returnStringe = "六";
break;
case '7':
returnString = "柒";
returnStringe = "七";
break;
case '8':
returnString = "扒";
returnStringe = "八";
break;
case '9':
returnString = "玖";
returnStringe = "九";
break;
default:
break;
}
return returnStringe;
}