資金金額 小寫轉大寫

2021-07-05 04:51:23 字數 1919 閱讀 4683

在涉及到資金金額時,常常會要求輸入阿拉伯數字,並給出漢語大寫的提示。

方法如下:

public static double yi = math.pow(10, 8); // 一億
public static string stryi = "億";

public static double qianwan = math.pow(10, 7); // 千萬

public static string strqianwan = "千萬";

public static double baiwan = math.pow(10, 6); // 百萬

public static string strbaiwan = "百萬";

public static double shiwan = math.pow(10, 5); // 十萬

public static string strshiwan = "十萬";

public static double wan = math.pow(10, 4); // 萬

public static string strwan = "萬";

public static double qian = math.pow(10, 3); // 千

public static string strqian = "千";

public static double bai = math.pow(10, 2); // 百

public static string strbai = "百";

public static double shi = math.pow(10, 1); // 十

public static string strshi = "十";

/// /// 0~9的大寫

///

///

///

public static string numbertochinese(double num)

return strchi;

}/// /// 獲得萬之前的數字

///

///

///

public static string getdanweibeforewan(double num)

if (num % qian == 0)

tmp = num / bai;

if ((int)tmp > 0)

if (num % bai == 0)

tmp = num / shi;

if ((int)tmp > 0)

else

upchinese = desc + upchinese;

return upchinese;

}/// /// 獲得萬之後的數字

///

///

///

public static string getdanweibeforyi(double num)

/// /// 獲得億之後的數字

///

///

///

public static string getdanweiyi(double num)

/// /// 把字串形式的數字轉為大寫

///

///

///

private static string upchinese = string.empty;

public static string getupchinesefromnum(string numstr)

// 小數點後轉成大寫

if (double.tryparse(hind, out tmp))}}

return preup + hindup;

}else

}

金額小寫轉大寫

create procedure dbo trannumbertobigfordecrypt n lowermoney numeric 15,2 v transtype int,ret varchar 200 output with encryption as descript 解密exec sp ...

金額小寫轉大寫

create procedure dbo trannumbertobigfordecrypt n lowermoney numeric 15,2 v transtype int,ret varchar 200 output with encryption as descript 解密exec sp ...

ORACLE 小寫金額轉大寫金額

create or replace function money2chinese money in number return varchar2 is stryuan varchar2 150 stryuanfen varchar2 152 numlenyuan number numlenyuanf...