当前位置: 技术问答>java相关
急救:如何在jsp中将阿拉伯数字转换成中文大写,如:'1228008.98' 转换为 '壹佰贰拾贰万扒仟零扒圆玖角扒分'各位大虾给看看,一定给分!!
来源: 互联网 发布时间:2015-03-05
本文导语: 急救:如何在jsp中将阿拉伯数字转换成中文大写,如:'1228008.98' 转换为 '壹佰贰拾贰万扒仟零扒圆玖角扒分'各位大虾给看看,一定给分!!!!! | /** *把小写转换为中文大写 **/ public s...
急救:如何在jsp中将阿拉伯数字转换成中文大写,如:'1228008.98' 转换为 '壹佰贰拾贰万扒仟零扒圆玖角扒分'各位大虾给看看,一定给分!!!!!
|
/**
*把小写转换为中文大写
**/
public static String toChinaUpper(float varf)throws Exception{
String[] rmblist=new String[] {"分","角","元","拾","佰","仟","万","拾","佰","仟","亿","拾","佰","仟","万"};
String[] upperlist=new String[] {"零","壹","贰","肆","伍","陆","柒","捌","玖"};
int intmp=(int)((varf*100)/1);
String intstr=Integer.toString(intmp);
int strlen=intstr.length();
String upperstr="";
int modnum=1;
int strloc=0;
for(int i=0;i
*把小写转换为中文大写
**/
public static String toChinaUpper(float varf)throws Exception{
String[] rmblist=new String[] {"分","角","元","拾","佰","仟","万","拾","佰","仟","亿","拾","佰","仟","万"};
String[] upperlist=new String[] {"零","壹","贰","肆","伍","陆","柒","捌","玖"};
int intmp=(int)((varf*100)/1);
String intstr=Integer.toString(intmp);
int strlen=intstr.length();
String upperstr="";
int modnum=1;
int strloc=0;
for(int i=0;i