zoukankan      html  css  js  c++  java
  • js

    //获得String类型百分数(0.00%)
    double percent=count1/Double.valueOf(c1.getString("c_input")).doubleValue();
    NumberFormat nt = NumberFormat.getPercentInstance();
    nt.setMinimumFractionDigits(2);//保留两位小数
    String c_percent=nt.format(percent);
    //String 转double
    double d=Double.valueOf(c1.getString("c_input")).doubleValue()
    //String 转int
    int num=Integer.parseInt(s);
    //int 转String
    String num1=Integer.toString((Integer)listByJDBC1.get(0).get("num"));
     
     
    //去重 查询数量
    select count(DISTINCT c_customerId)as num from crm_Contract
    select distinct bscc_type from bas_commontable_column//去重查询
    //复选框
    <div class="checkbox">
    <label>
    <input type="checkbox" id="isAble_1" name="isAble_1" onClick='setCheckBox()'>${uiLabelMap.Open}
    </label>
    </div>
    <input type='hidden' id="c_ex10" name="c_ex10"/>
    </td>
     
     
    function setCheckBox(){
    if($("#isAble_1").prop("checked"))
    $("#c_ex10").val("Y");
    else
    $("#c_ex10").val("N");
    }
     
    if($("#c_ex10").val()=="Y")
    $("#isAble_1").prop("checked",true);
    else
    $("#isAble_1").prop("checked",false);
     
    //复选框
    <td colspan='2'>
    <input id='pc_ex52_' name='pc_ex52_' value='N' type='checkbox' onClick='setValues(this)' setid='pc_ex52'/><label for="so_ex50_">慈善</label>
    <input id='pc_ex52' name='pc_ex52' value='<%=dd.getValue("pc_ex52") %>' type='hidden'/>
    </td>
     
    function setValues(o){
    var setid=$(o).attr("setid");
    if($(o).prop("checked")){
    $("#"+setid).val("Y");
    }else{
    $("#"+setid).val("N");
    }
    }
     
    if($("#pc_ex52").val()=="Y")
    $("#pc_ex52_").prop("checked",true);
    //输入数字 小数
    <td >
    <input class="form-control" id="c_ex9" name="c_ex9" onchange="fixNumber(this,2,true)" style='100%'/>
    </td>
     
    //控制输入数字 小数点 onchange="fixNumber(this,2,true)"
    function fixNumber(o,n,b){
    if(typeof(o)=="string"){
    o=document.getElementById(o);
    }
    if(typeof(n)=="string"){
    n=Number($("#"+n).val());
    };
    if(o.value==""||isNaN(o.value)||o.value==Infinity){
    o.value=parseFloat("0").toFixed(n);
    }else{
    o.value=parseFloat(o.value).toFixed(n);
    }
    if(b!=null&&b==true){
    if(Number(o.value)==0){
    o.value="";
    }
    }
    }
     
     
    //js 保留两位小数
    function returnFloat(value){//保留两位小数
    var value=Math.round(parseFloat(value)*100)/100;
    var xsd=value.toString().split(".");
    if(xsd.length==1){
    value=value.toString()+".00";
    return value;
    }
    if(xsd.length>1){
    if(xsd[1].length<2){
    value=value.toString()+"0";
    }
    return value;
    }
    }
     
    // replace(c_ex46,char(10),',') 把 换行 换成 逗号 sql语句
    select ','+replace(c_ex46,char(10),',')+',' from t_nowinv
    where ','+replace(c_ex46,char(10),',')+',' like '%,4H0919275,%'
     
    order by c_ex46 asc
     
    //年月日
    $("#c_dat5").val(unescape(sui.info[0].c_dat5).substring(0,10));
    //年月日 时分
    $("#c_dat5").val(unescape(sui.info[0].c_dat5).substring(0,10));
     
     
  • 相关阅读:
    Vue.Js(html5) + Java实现文件分片上传
    进程、线程基础知识全家桶,30 张图一套带走
    20 张图揭开「内存管理」的迷雾,瞬间豁然开朗
    面试官:换人!他连 TCP 这几个参数都不懂
    TCP 半连接队列和全连接队列满了会发生什么?又该如何应对?
    实战!我用 Wireshark 让你“看得见“ TCP
    IP 基础知识全家桶,45 张图一套带走
    写了Bug,误执行 rm -fr /*,我删删删删库了,要跑路吗?
    你还在为 TCP 重传、滑动窗口、流量控制、拥塞控制发愁吗?看完图解就不愁了
    硬不硬你说了算!35 张图解被问千百遍的 TCP 三次握手和四次挥手面试题
  • 原文地址:https://www.cnblogs.com/leo0705/p/8473124.html
Copyright © 2011-2022 走看看