using System;
using System.Collections.Generic;
namespace WaiShiBan
{
public class RBM
{
public static string[] ZhongWen = new string[] { “零”,”壹”, “贰”, “叁”, “肆”, “伍”, “陆”, “柒”, “捌”, “玖” };
public static string[] ZWzhengshu = new string[] {“”, “拾”, “佰”, “千” };
public static string[] ZWwan = new string[] { “元”, “万”, “亿”};
public static string Retulstring=”“;
public static string toDaXie(double r)
{
if ((r*100 - Math.Floor(r*100)!=0) || r>999999999999)
{
return “只保留两位小数”;//只要两位小数
}
//文本化
string SR = Math.Floor(r * 100).ToString();
string XiaoShu = SR.Substring(SR.Length - 2, 2);
string ZhengShu = SR.Substring(0, SR.Length - 2);
//取小数
string xiaoshuS = ZhongWen[Convert.ToInt16(XiaoShu.Substring(0,1))] +”角”+ ZhongWen[Convert.ToInt16(XiaoShu.Substring(1, 1))]+”分”;
//4位一取,保证元、万、亿 <
c# 数字转大写中文
最新推荐文章于 2022-07-23 21:00:00 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)