金额转中文java,求java写将double型数目字(金额转换成)中文大写,

当前位置:我的异常网» J2SE » 求java写将double型数目字(金额转换成)中文大写,

求java写将double型数目字(金额转换成)中文大写,

www.myexceptions.net  网友分享于:2013-12-21  浏览:58次

求java写将double型数字(金额转换成)中文大写,急!

急需求java写将double型数字(金额转换成)中文大写!

------解决方案--------------------

public class Change1

{

public String change(String integer, String decimal)

{

String output = new String();

String output1 = new String();

String output2 = new String();

String temp1 = new String();

//String temp2= " ";

output1 = tochinese(integer.toCharArray());

int j = 0,k=0;

k=output1.length();

for (int i = k; i > 0; i--)

{

temp1 = output1.substring(i-1, i);

/**if(temp1.equals( "零 "))

{

if(temp1.equals(temp2)){

temp2=temp1;

temp1= " ";}

else {

temp2=temp1;

if(i==k)temp1= " ";

}

System.out.println(temp1);

}

else

{

temp2= " ";

*/

switch (j%4)

{

case 0:

break;

case 1:

temp1 += "拾 ";

break;

case 2:

temp1 += "佰 ";

break;

case 3:

temp1 += "仟 ";

break;

}

if (j==4||j==12)

temp1 += "万 ";

if (j==8)

temp1 += "亿 ";

output = temp1 + output;

j++;

}

output+= " "+ " "+ " ";

System.out.println(output);

int s=0;

文章评论

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值