public class toChinese
{
public toChinese()
{
}
public static String ConvetC(BigDecimal bds)
{
String strZero =
String strYuan =
String strJiao =
String strFen =
String strZheng =
String strItem[] = {
String strC[]={
String strB[]={
String strChinese = new String(
String strSource = bds
String[] strDesk;
String strPrec = new String(
int i =
iNumber = strSource
strPrec = strSource
//System
iPrec = strSource
iItem = (int)((iNumber+
strDesk = new String[iItem];
//System
for(i=
{
iLoc = (iNumber
//System
strDesk[i] =
int iNowItem[] = {
for(j= (i*
{
iNowItem[j
//System
}
strDesk[i] = strItem[i];
//System
if(iNowItem[
{
strDesk[i] = strC[iNowItem[
}
if(iNowItem[
{
strDesk[i] = strC[iNowItem[
}
else if(iNowItem[
{
strDesk[i] = strZero + strDesk[i];
}
if(iNowItem[
{
strDesk[i] = strC[iNowItem[
}
else if(iNowItem[
{
strDesk[i] = strZero + strDesk[i];
}
if(iNowItem[
{
strDesk[i] = strC[iNowItem[
}
else if(iNowItem[
{
strDesk[i] = strZero + strDesk[i];
}
if(iNowItem[
{
strDesk[i] = strZero;
if(i==
{
strDesk[i] =
}
else if (strDesk[i
{
strDesk[i] =
}
}
strChinese = strDesk[i] + strChinese ;
}
strChinese = strChinese + strYuan;
int iJiao=
try
{
iJiao = (int)(strPrec
}
catch(Exception e
{
}
try
{
iFen = (int)(strPrec
}
catch(Exception e
{
}
if(iJiao>
{
strChinese = strChinese + strC[iJiao] + strJiao ;
}
if(iFen>
{
strChinese = strChinese + strC[iFen] + strFen ;
}
else
strChinese = strChinese + strZheng ;
//System
return(strChinese);
}
public static void main(String[] args)
{
BigDecimal bdtest = new BigDecimal(
System
}
}
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19781.html