代码如下://人民币金额转大写程序 Javascr ipt版 //CopyRight Bardo QI function numToCny(num){ var capUnit = [‘万’,’亿’,’万’,’圆’,”]; var capDigit = { 2:[‘角’,’分’,”], 4:[‘仟’,’佰’,’拾’,”]}; var capNum=[‘零’,’壹’,’贰’,’叁’,’肆’,’伍’,’陆’,’柒’,’捌’,’玖’];
直接来看代码:
public static string ConvertToChineseMoney(double money)
{
if (money < 0)
throw new ArgumentOutOfRangeException(参数money不能为负值!);
string s = money.ToString(#L#E#D#C#K#E#D#C#J#E#D#C#I#E#D#C#H#E#D#C#G#E#D#C#F#E#D#C#.0B0A);