对位拆分数字金额

Posted yunfeiyang-88

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了对位拆分数字金额相关的知识,希望对你有一定的参考价值。

<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>拆分金额</title> <script type="text/javascript" src="js/jquery-1.8.3.min.js"></script> <script> $(function(){ initPage(); }); function initPage() { var issueList = ["issueFen", "issueJiao", "dian", "issueYuan", "issueShi", "issueBai", "issueQian", "issueWan", "issueShiW", "issueBaiW", "issueQianW", "issueYi"]; var availableList = ["availableFen", "availableJiao", "dian", "availableYuan", "availableShi","availableBai", "availableQian", "availableWan", "availableShiW", "availableBaiW", "availableQianW", "availableYi"]; var str1 = "12456789.85"; var str2 = "8946546.33"; readAmount(str1, issueList); readAmount(str2, availableList); } function readAmount(str, list) { var size = str.length; for (var i=0; i<size; i++) { $("#"+ list[i]).html(str.substring(str.length-1)); str = str.substring(0, str.length-1); } } </script> </head> <body> <table border="1" cellspacing="0" cellpadding="5"> <tr><td>亿</td><td>仟</td><td>佰</td><td>拾</td><td>万</td><td>仟</td><td>佰</td><td>拾</td><td>元</td><td>角</td><td>分</td></tr> <tr><td id="issueYi"></td><td id="issueQianW"></td><td id="issueBaiW"></td> <td id="issueShiW"></td><td id="issueWan"></td><td id="issueQian"></td><td id="issueBai"></td> <td id="issueShi"></td><td id="issueYuan"></td><td id="issueJiao"></td><td id="issueFen"></td> </tr> <tr><td>亿</td><td>仟</td><td>佰</td><td>拾</td><td>万</td><td>仟</td><td>佰</td><td>拾</td><td>元</td><td>角</td><td>分</td></tr> <tr><td id="availableYi"></td><td id="availableQianW"></td><td id="availableBaiW"></td> <td id="availableShiW"></td><td id="availableWan"></td><td id="availableQian"></td><td id="availableBai"></td> <td id="availableShi"></td><td id="availableYuan"></td><td id="availableJiao"></td><td id="availableFen"></td> </tr> </table> </html>

以上是关于对位拆分数字金额的主要内容,如果未能解决你的问题,请参考以下文章

我们如何使用贝宝支付流来拆分金额

在同一行转置(枢轴)中按百分比拆分的复杂 SQL 金额?

准时下班系列!Excel合集之第6集—如何拆分和统计单据金额

js怎么把数字金额转换成中文大写金额

小写金额怎样生成大写

数字金额转换为汉字金额