public static string Capitalization(double B_SW)
{
long L_SW,L_I=0;
// string [] S_BW_FIG={"零","一","二","三","四","五","六","七","八","九","整"};
string [] S_BW_FIG={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖","整"};
string [] S_UNIT={"分","角","元","十","百","千","万","十","百","千","亿","十","百","千"};
string S_BW="";bool B_Flag=true;
L_SW=(long)(100*B_SW+0.5);
while (L_SW>0)
{
if (L_SW%10!=0 )
{
S_BW=S_BW_FIG[L_SW%10]+S_UNIT[L_I]+S_BW;B_Flag=true;
}
else
{
if ((L_I==2 & (long)(100*B_SW)/100>0) || (L_I==6 & (long)(100*B_SW)/1000000>0 & ((long)(100*B_SW)/1000000)%10000>0 ) || (L_I==10 & (long)(100*B_SW)/10000000000>0))
{
S_BW=S_UNIT[L_I]+S_BW;B_Flag=false;
}
else
{
if (L_I>2 & B_Flag)
{
S_BW=S_BW_FIG[L_SW%10]+S_BW;B_Flag=false;
}
else
{
if (L_I!=6 || L_I!=10) B_Flag=false;
}
}
}
L_SW=L_SW/10;L_I++;
}
if ((long)(100*B_SW+0.5)%100==0) S_BW+="整";
return S_BW;
}
如何将12345这样的数字转换成相对应的大写的中文字? 比如:壹万贰千弎百肆十伍。
最新推荐文章于 2023-03-04 18:54:45 发布