原文参考 逛到一道面试题,数字转大写中文的,搜索学习并记录于此. //自动转换数字金额为大小写中文字符,返回大小写中文字符串,最大处理到999兆 function changeMoneyToChinese( money ) { var cnNums = new Array("零","壹","贰","叁","肆","伍","陆","柒","…
function DX(n){ if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) return ""; var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = ""; n += "00"; var p = n.indexOf('.'); if (p >= 0) n = n.substring(0, p) + n.substr(p+1, 2); unit = unit.substr…
最近穷死了 ,没钱吃饭ing 写点钱给自己吧!public class Test{ public static String getChar(long a){ int b = (int)a; Map map = new HashMap(); map.put(0,"零"); map.put(1,"壹"); map.put(2,"贰"); map.put(3,"叁"); map.put(4,"肆"); map.…
function toUpper(n) { n = n+''; var unit = '十百千万'; var num = '一二三四五六七八九 '; var array = new Array(); for (var i=n.length; i > 0; i--){ var numIndex = parseInt(n.charAt(i-1))-1; if(n.length>1 && i > 1){ //个位 array.unshift(num.charAt(numInde…
function TForm1.changeRmb(const strRmb:string):string; var txt,strhighlevel:string; i,n,m,ilen,ipos:Integer; //n记录整数部分长度,m记录分数部分长度 strarray,strlevel:array of string; p:pchar; ispoint:boolean;//判断是否有小数点 begin ispoint:=false; result:=''; ipos:=0; m:=0;…
CREATE FUNCTION [dbo].[f_num_chn] (@num numeric(14,5))RETURNS varchar(100) WITH ENCRYPTIONASBEGIN--版权所有:weihuachao@sina.com DECLARE @n_data VARCHAR(20),@c_data VARCHAR(100),@n_str VARCHAR(10),@i int SET @n_data=RIGHT(SPACE(14)+CAST(CAST(ABS(@num*…
<script language="jscript"> function convertCurrency(currencyDigits) { // Constants: var MAXIMUM_NUMBER = 99999999999.99; // Predefine the radix characters and currency symbols for output: var CN_ZERO = "零"; var CN_ONE = "壹&…