js进行计算 获取TH对象

来源:互联网 发布:淘宝商家人工电话 编辑:程序博客网 时间:2024/06/11 02:29
            <div id="lineTableDiv" style="min-height:200px;">
                                    <table id="lineTable" class="table table-striped m-b-none" date-ride="datatables">
                                        <thead>
                                            <tr>
                                                <th width="50px">行号</th>
                                                <th>项目编号</th>
                                                <th>项目名称</th>
                                                <th>项目简称</th>
                                                <th>项目所属</th>
                                                <th>业主名称</th>
                                                <th>项目重要程度</th>
                                                <th>项目属性</th>
                                                <th>项目合同额估算</th>
                                                <th>审批状态</th>
                                                <th width="20px"></th>
                                            </tr>

                                        </thead>

----------获取TH对象中的名称

valArr=[];
     $("#lineTable").find("th").each(function(i){
         valArr.push($.trim($(this).text()));
         valArr.join(",")
      });


var a=parseFloat(valueAmount);

转换类型,方可进行计算


var e=Math.round(c / d * 10000) / 100.00 + "%";

保留2位小数

var  valueStatus=(way.getJSON("data.cuxEpcValueConfirmHdrsEO.valueStatusCode"))

var reg = new RegExp('"',"g");  
valueStatus = valueStatus.replace(reg, "");

去除字符串双引号

0 0