数字大小写转换问题(C#)

来源:百度知道 编辑:UC知道 时间:2024/05/09 15:15:19
我想把一个随机的阿拉伯数字转换成对应的大小(一、二、三...)怎么实现?

写的有点烂,见谅见谅.....

using System;
using System.Collections.Generic;
using System.Text;
class Program
{
static string[] c_Num1 ={ "零", "一", "二", "三", "四", "五", "六", "七", "八", "九" };
static string[] c_fh ={ "", "十", "百", "千" };
static string[] c_we ={ "", "万", "亿", "亿亿" };

private static string convert(int n)
{
string s = n.ToString();
string ss = "";
bool frist = true;
for (int i = s.Length - 1; i >= 0; i--)
{
if (s[i] == '0')
{
if (s[i - 1] == '0')
continue;
else
if (!frist)
ss = c_Num