题意:
读入一个浮点数值,将其转化为中文金额的大写方式.
试验要求:
当金额为整数时,只表示整数部分,省略小数部分,并添加"整"字.
当金额中含有连续的0时,只需要一个"零"即可.
10的表示方式.例如110--壹佰一拾元整,10---一拾元整
1 import java.io. * ;
2 class chineseMoney ... {
3 private String number[]=...{ "","壹","贰","叁","肆","伍","陆","柒","捌","玖"};
4 private String unit[]=...{ "","拾","佰","仟"};
5 private String small[]=...{ "角","分"};
6 //private String strNumber,strUnit,strAll;
7
8 //是否在number中
9 private boolean IsInNumber(String strNumber)
10 ...{
11 boolean inNumber=false;
12 for (int i=0;i<9;i++)
13 ...{
14 if (strNumber.compareTo (number[i])==0) inNumber=true;
15 }
16 return inNumber;
17 }
18
19
20 private String SplitChineseNumber(int intUnit,String strInt)
21 ...{
22 int l=strInt.length ();
23 int j,k,zeorCountTemp=0;
24 String strUnit="",strNumber="",strAll="";
25
26 //判断在千万到万位 是否全为0,是的话,不返回“万”,返回“”;
27 boolean temp=false;
28 for (k=0;k<l;k++)
29 ...{
30 String strTemp=strInt.substring(k,k+1);
31 int intTemp=Integer.parseInt(strTemp);
32
33 if (intTemp!=