Private string Num2TraWord (string MoneyNoStr)
{
String sourNostr = MoneyNoStr;
String [] strary = sourNostr. Split ('.');
If (strary [0]. Length> 0)
Strary [0] = strary [0]. Insert (strary [0]. Length, "Yuan ");
If (strary [0]. Length> 2)
Strary [0] = strary [0]. Insert (strary [0]. Length-2, "Pick ");
If (strary [0]. Length> 4)
Strary [0] = strary [0]. Insert (strary [0]. Length-4, "Ignore ");
If (strary [0]. Length> 6)
Strary [0] = strary [0]. Insert (strary [0]. Length-6, "break ");
If (strary [0]. Length> 8)
Strary [0] = strary [0]. Insert (strary [0]. Length-8, "Ten Thousand ");
If (strary [0]. Length> 10)
Strary [0] = strary [0]. Insert (strary [0]. Length-10, "Pick ");
If (strary [0]. Length> 12)
Strary [0] = strary [0]. Insert (strary [0]. Length-12, "Ignore ");
If (strary [0]. Length> 14)
Strary [0] = strary [0]. Insert (strary [0]. Length-14, "Ignore ");
Try
{
If (strary [1]. Length> 0)
Strary [1] = strary [1]. Insert (1, "");
If (strary [1]. Length> 2)
Strary [1] = strary [1]. Insert (3, "points ");
SourNostr = strary [0] + strary [1];
}
Catch
{
SourNostr = strary [0];
}
SourNostr = sourNostr. Replace ("0", "0 ");
SourNostr = sourNostr. Replace ("1", "1 ");
SourNostr = sourNostr. Replace ("2", "II ");
SourNostr = sourNostr. Replace ("3", "San ");
SourNostr = sourNostr. Replace ("4", "Si ");
SourNostr = sourNostr. Replace ("5", "Wu ");
SourNostr = sourNostr. Replace ("6", "land ");
SourNostr = sourNostr. Replace ("7", "success ");
SourNostr = sourNostr. Replace ("8", "success ");
SourNostr = sourNostr. Replace ("9", "success ");
SourNostr = sourNostr. Replace ("-", "negative ");
Return sourNostr;
}
II,
Private string Num2TaiWangWord (string MoneyNoStr)
{
String sourNostr = (Decimal. Parse (MoneyNoStr) * 100). ToString ("0 #");
String [] InsertChar = {"points", "Corner", "Yuan", "Pick", "Hour", "Ten Thousand", "Pick ", "Province", "Province "};
Int InsertPointer;
Int IntIndex = 0;
For (InsertPointer = sourNostr. Length; InsertPointer> 0; InsertPointer --)
{
If (IntIndex % 4) = 2) | (sourNostr. Substring (InsertPointer-1, 1 )! = "0 "))
SourNostr = sourNostr. Insert (InsertPointer, InsertChar [IntIndex]);
IntIndex ++;
If (IntIndex> 10)
IntIndex-= 8;
}
SourNostr = sourNostr. Replace ("RMB 00", "RMB ");
SourNostr = sourNostr. Replace ("00", "0 ");
SourNostr = sourNostr. Replace ("00", "0 ");
SourNostr = sourNostr. Replace ("0 yuan", "Yuan ");
SourNostr = sourNostr. Replace ("0 thousand", "million ");
SourNostr = sourNostr. Replace ("0 billion", "");
SourNostr = sourNostr. Replace ("hundreds of millions", "hundreds of millions ");
SourNostr = sourNostr. Replace ("0", "0 ");
SourNostr = sourNostr. Replace ("1", "1 ");
SourNostr = sourNostr. Replace ("2", "II ");
SourNostr = sourNostr. Replace ("3", "San ");
SourNostr = sourNostr. Replace ("4", "Si ");
SourNostr = sourNostr. Replace ("5", "Wu ");
SourNostr = sourNostr. Replace ("6", "land ");
SourNostr = sourNostr. Replace ("7", "success ");
SourNostr = sourNostr. Replace ("8", "success ");
SourNostr = sourNostr. Replace ("9", "success ");
SourNostr = sourNostr. Replace ("-", "(negative )");
Return sourNostr;
}