- 打印本文 关闭窗口
- jsp页面调用applet实现人民币的大小写转换
- 作者:采集员 文章来源:来源于网络 点击数: 更新时间:2005/9/10 14:27:36
- mb_temp;
}
public String getRMB(String rmb_temp){
if(checkNum(rmb_temp)){
if(rmb_temp.endsWith(".")){
rmb_temp = rmb_temp.substring(0,rmb_temp.length()-1);
}
re_rmb= rmb.RMB(rmb_temp);
}else{
re_rmb="输入错误:"+rmb_temp;
}
return re_rmb;
}
public boolean checkNum(String str){
String numChar="0123456789.";
boolean breakBoolean = false;
for(int i=0;i<str.length();i++){
if(numChar.indexOf(str.substring(i,i+1))<0){
breakBoolean =true;
}
if(breakBoolean) break;
}
if(breakBoolean){
return false;
}else{
if(str.startsWith(".")){
return false;
}else{
return true;
}
}
}
public String[][] getParameterInfo() {
String[][] pinfo =
{
{"RGB_Back", "String", ""},
{"RGB_Fore", "String", ""},
{"WIGTH", "String", ""},
};
return pinfo;
}
private int[] getColor(String rgb){
int[] rgb_return = new int[3];
int index =0,nextIndex=0,len=0;
while((index =rgb.indexOf("|",nextIndex))>-1){
rgb_return[len]=getInt(rgb.substring(nextIndex,index));
nextIndex=index+1;
len++;
}
rgb_return[len]=getInt(rgb.substring(nextIndex));
return rgb_return;
}
private int getInt(String str){
try{
return Integer.parseInt(str);
}catch(Exception e){
return 0;
}
}
}
2.java包,欢迎索取lqhboy@163.com
- 打印本文 关闭窗口