将阿拉伯数字转化成大写的人民币数字
2007-10-27 01:08
316 查看
将阿拉伯数字转化成大写的人民币数字
public String getNumberToRMB(String m)...{
String num = "零壹贰叁肆伍陆柒捌玖";
String dw = "圆拾佰仟万亿";
String mm[] = null;
mm = m.split("/.");
String money = mm[0];
String result = num.charAt(Integer.parseInt("" + mm[1].charAt(0))) + "角" +
num.charAt(Integer.parseInt("" + mm[1].charAt(1))) + "分";
for (int i = 0; i < money.length(); i++) ...{
String str = "";
int n = Integer.parseInt(money.substring(money.length() - i - 1,
money.length() - i));
str = str + num.charAt(n);
if (i == 0) ...{
str = str + dw.charAt(i);
}
else if ( (i + 4) % 8 == 0) ...{
str = str + dw.charAt(4);
}
else if (i % 8 == 0) ...{
str = str + dw.charAt(5);
}
else ...{
str = str + dw.charAt(i % 4);
}
result = str + result;
}
result = result.replaceAll("零([^亿万圆角分])", "零");
result = result.replaceAll("亿零+万","亿零");
result = result.replaceAll("零+", "零");
result = result.replaceAll("零([亿万圆])", "");
result =result.replaceAll("壹拾","拾");
return result;
}
public String getNumberToRMB(String m)...{
String num = "零壹贰叁肆伍陆柒捌玖";
String dw = "圆拾佰仟万亿";
String mm[] = null;
mm = m.split("/.");
String money = mm[0];
String result = num.charAt(Integer.parseInt("" + mm[1].charAt(0))) + "角" +
num.charAt(Integer.parseInt("" + mm[1].charAt(1))) + "分";
for (int i = 0; i < money.length(); i++) ...{
String str = "";
int n = Integer.parseInt(money.substring(money.length() - i - 1,
money.length() - i));
str = str + num.charAt(n);
if (i == 0) ...{
str = str + dw.charAt(i);
}
else if ( (i + 4) % 8 == 0) ...{
str = str + dw.charAt(4);
}
else if (i % 8 == 0) ...{
str = str + dw.charAt(5);
}
else ...{
str = str + dw.charAt(i % 4);
}
result = str + result;
}
result = result.replaceAll("零([^亿万圆角分])", "零");
result = result.replaceAll("亿零+万","亿零");
result = result.replaceAll("零+", "零");
result = result.replaceAll("零([亿万圆])", "");
result =result.replaceAll("壹拾","拾");
return result;
}
相关文章推荐
- 将阿拉伯数字转化成大写的人民币数字
- 将阿拉伯数字转化成大写的人民币数字
- 将阿拉伯数字转化成大写的人民币数字
- 将阿拉伯数字转化为人民币的大写
- 银行货币单位阿拉伯数字转化中文大写 eclipse 下C 与java实现 MOOC
- 数字变成大写的类,把人民币转化为大写汉字
- PHP将数字金额转化为中文人民币大写
- 将人民币的数字表示转化成大写表示(C#版)
- 将人民币的数字表示转化成大写表示(C#版)
- 将人民币的数字表示转化成大写表示(C#版)
- java代码中将金额阿拉伯数字转化为中文大写
- 将货币数字(阿拉伯数字)(小写)转化成中文(大写)
- 数字转化为人民币大写(PHP)
- C# 人民币大小写转换,将阿拉伯数字转换为中文的大写人民币
- 将人民币中的阿拉伯数字转换为大写
- PHP将数字金额转化为中文人民币大写
- 人民币大写转阿拉伯数字
- 金额大小写转化、阿拉伯数字转大写数字,大写数字转阿拉伯数字
- java实现阿拉伯数字转人民币大写(精确到分)
- php阿拉伯数字转中文人民币大写