private
static
string
[] cstr
=
{
"
零
"
,
"
壹
"
,
"
贰
"
,
"
叁
"
,
"
肆
"
,
"
伍
"
,
"
陆
"
,
"
柒
"
,
"
捌
"
,
"
玖
"
};
private
static
string
[] wstr
=
{
""
,
"
拾
"
,
"
佰
"
,
"
仟
"
,
"
萬
"
,
"
拾
"
,
"
佰
"
,
"
仟
"
,
"
億
"
,
"
拾
"
,
"
佰
"
,
"
仟
"
};
///
<summary>
///
数字转化为大写中文
///
</summary>
///
<param name="strNumber"></param>
///
<returns></returns>
public
string
ToUpperStr(
string
strNumber) {
int
intLength
=
strNumber.Length;
string
strTemp
=
""
;
string
strResult
=
""
;
for
(
int
i
=
0
; i
<
intLength;i
++
) { strTemp
=
strNumber.Substring(intLength
-
i
-
1
,
1
); strResult
=
String.Concat(cstr[Int32.Parse(strTemp)]
+
wstr[i], strResult); } strResult
=
strResult.Replace(
"
拾零
"
,
"
拾
"
); strResult
=
strResult.Replace(
"
零拾
"
,
"
零
"
); strResult
=
strResult.Replace(
"
零佰
"
,
"
零
"
); strResult
=
strResult.Replace(
"
零仟
"
,
"
零
"
); strResult
=
strResult.Replace(
"
零萬
"
,
"
萬
"
);
for
(
int
i
=
1
; i
<=
6
;i
++
) { strResult
=
strResult.Replace(
"
零零
"
,
"
零
"
); } strResult
=
strResult.Replace(
"
零萬
"
,
"
零
"
); strResult
=
strResult.Replace(
"
零億
"
,
"
億
"
); strResult
=
strResult.Replace(
"
零零
"
,
"
零
"
);
return
strResult; }
转载于:https://www.cnblogs.com/xiebin1986/archive/2010/04/26/1721397.html
相关资源:MySQL函数-数字转换为大写中文
转载请注明原文地址: https://mac.8miu.com/read-12577.html