人民币 小写金额转换为大写金额

### 人民币 小写金额转换为大写金额

标签(空格分隔): 人民币 小写金额转换为大写金额

---

jsp:
```
div class="form-group">
<label class="col-sm-4 control-label">
合计人民币金额(小写):
</label>
<div class="col-sm-7">
<input id="totalRmbLower" type="text" name="entity.totalRmbLower" value="${entity.totalRmbLower}" placeholder="" class="form-control">
</div>
</div>
```

js:将输入的小写金额 转换成大写金额
```
function arabiaToChinese(num) {
if (isNaN(num)) return "";
var strPrefix = "";
if (num <
0) strPrefix = "(负)";
num = M ath.abs(num);
if (num >= 1000000000000) return "无效数值!";
var strOutput = "";
var strUnit = ‘仟佰拾亿仟佰拾万仟佰拾元角分‘;
var strCapDgt = ‘零壹贰叁肆伍陆柒捌玖‘;
num += "00";
var intPos = num.indexOf(‘.‘);
if (intPos >= 0) { num = num.substring(0, intPos) + num.substr(intPos + 1, 2); }
strUnit = strUnit.substr(strUnit.length -
num.length);
for (var i = 0; i <
num.length; i++) { strOutput += s trCapDgt.substr(num.substr(i, 1), 1) + strUnit.substr(i, 1); }
return strPrefix + strOutput.replace(/零角零分$/, ‘整‘).replace(/零[仟佰拾]/g, ‘零‘).replace(/零{2,}/g, ‘零‘).replace(/零([亿|万])/g,
‘$1‘).replace(/零+元/, ‘元‘).replace(/亿零{0,3}万/, ‘亿‘).replace(/^元/, "零元");
}
```

js:
```
$("#totalRmbLower").focus(function() {
var totalRmbLower = 0;
for (var i = 0; i < cList.length; i++) {
totalRmbLower = cList[i].amount + totalRmbLower;
}
$("input[name=‘entity.totalRmbLower‘]").val(totalRmbLower);
});
```

时间: 2024-10-14 05:45:37

人民币 小写金额转换为大写金额的相关文章

人民币小写金额转大写金额

#region 人民币小写金额转大写金额 /// <summary> /// 小写金额转大写金额 /// </summary> /// <param name="Money">接收需要转换的小写金额</param> /// <returns>返回大写金额</returns> public static string ConvertMoney(this decimal Money) { //金额转换程序 string

Oracle 小写金额转换为大写

在开发EBS的合同报表打印的时候需要将小写金额转换为大写. 如下是本人自己写的转换函数. 主要思路:先获取小数点位置,在区分整数与小数点处理,根据位数和数字组合读取金额. 最后再处理特殊显示部分. /******************************************************************* *  FUNCTION get_big_amount 数字金额转换为大写 *  p_amount 输入数据金额 *  返回大写金额,位数 :千亿----厘 ****

C#:小写金额转换为大写

#region 小写金额转换为大写 public static string CurrToChnNum(double Currnum) { string sResult = ""; if (Math.Abs(Currnum) < 1e-20) return "零圆整"; if (Currnum < 1e-20) sResult = "负"; sResult = sResult + StringToChnNum(Math.Abs(Mat

numberToCapital() JavaScript数字金额转换为大写金额

function numberToCapital(number) { if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(number)) { return "数字格式不正确!" } // 如果有小数,截取整数位和小数位 number += '00'; var pointIndex = number.indexOf('.'); if (pointIndex > -1) { number = number.substring(0, pointIndex) + nu

人民币数字金额转大写金额

public class t { public static String Trans2RMB(String money) { int index = money.indexOf("."); if (index < 0) {// 没有角分 money = money + ".00"; index = money.indexOf("."); } if (money.substring(index, money.length()).length

java将小写金额转换为大写的工具类

public class Tool {             private static final String UNIT = "万千佰拾亿千佰拾万千佰拾元角分";         private static final String DIGIT = "零壹贰叁肆伍陆柒捌玖";         private static final double MAX_VALUE = 9999999999999.99D;         public static St

小写金额转换大写金额

var digitUppercase = function(n) { var fraction = ['角', '分']; var digit = [ '零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖' ]; var unit = [ ['元', '万', '亿'], ['', '拾', '佰', '仟'] ]; var head = n < 0 ? '欠' : ''; n = Math.abs(n); var s = ''; for (var i

Excel小写金额转大写金额公式

=IF(ROUND(A6,2)<0,"无效数值",IF(ROUND(A6,2)=0,"零",IF(ROUND(A6,2)<1,"",TEXT(INT(ROUND(A6,2)),"[dbnum2]")&"元")&IF(INT(ROUND(A6,2)*10)-INT(ROUND(A6,2))*10=0,IF(INT(ROUND(A6,2))*(INT(ROUND(A6,2)*100)

C#把金额转换为汉字表达式

/* 创建者:菜刀居士的博客 * 创建日期: 2014年09月04号 * 功能:Money类型转换 * */ namespace Net.String.ConsoleApplication { using System; using System.Collections.Generic; public class MoneyHelper { public static string[] chineseDigits = new string[] { "零", "壹",