C 數字轉換成大寫漢字程式

2022-03-02 05:58:02 字數 1696 閱讀 6311

using system;

using system.collections.generic;

using system.text;

private double j;

///

///

///

private string numchinesecharacter = new string ;

public money(double m)

///

/// 判斷輸入的數字是否大於double型別

///

private bool isnumber

}///

/// 數字轉換成大寫漢字主函式

///

/// 返回轉換後的大寫漢字

public string convert()

else

}else

return bb;

}///

/// 小數字轉換只支援兩位的小數

///

/// 轉換的小數

/// 小數轉換成漢字

private string floatstring(string num)

else

else

}else

cc = bb + "分";

}return cc;

}///

/// 判斷數字位數以進行拆分轉換

///

/// 要進行拆分的數字

/// 轉換成的漢字

private string numberstring(string num)

else if (num.length > 4 && num.length <= 8)

else if (num.length > 8 && num.length <= 12)

return bb;

}///

/// 四位數字的轉換

///

/// 準備轉換的四位數字

/// 轉換以後的漢字

private string convert4(string num)

else if (num.length == 2)

else if (num.length == 3)

else

else

}else

}else

}return bb;

}///

/// 將數字轉換成漢字

///

/// 需要轉換的數字

/// 轉換後的漢字

private string convertstring(string num)

return bb;

}///

/// 兩位數字的轉換

///

/// 兩位數字

/// 轉換後的漢字

private string convert2(string num)

else

}else

cc = num;

return cc;

}///

/// 三位數字的轉換

///

/// 三位數字

/// 轉換後的漢字

private string convert3(string num)

else

}else

return bb;}}

}

數字轉換成大寫金額

數字轉換成大寫金額 using system public class numtocaps 將數定轉換大寫金額格式 引數必須小於萬萬億,且不超過兩位小數多過兩位自動擷取兩位 返回大寫金額 public string getcaps decimal d if d 0 if s.length 0 s.l...

數字轉換成大寫金額

數字轉換成大寫金額 例如 new money 200 tostring 貳佰元 namespace skyiv.util catch system.console.writeline 大寫 newmoney m 該類過載的 tostring 方法返回的是大寫金額字串 class money 建構函式...

將金額轉換成大寫漢字

integer li i integer li lendec,li lenint integer li amout flag integer li point string ls amount string string ls single string ls single dx string ls...