计算的时候随便用小数来计算,到输出时保留两位小数就好了  .toFixed(2)

解决方案 »

  1.   

    Math.round((1 - de) * 100) / 100;
      

  2.   

    这个当没说,,,我上面都说用了Math.round((1 - de) * 100) / 100; 又复制一遍
      

  3.   

    这个当没说,,,我上面都说用了Math.round((1 - de) * 100) / 100; 又复制一遍
    你上面写的是Math.round((1 - de) * 100 / 100);
    正确的 是ath.round((1 - de) * 100) / 100; 
      

  4.   


    var de = 9/10;
    var v = Math.round((1 - de) * 100) / 100;
    alert(v);//输出 0.1
      

  5.   

    Math.round((1 - de) * 100 / 100);输出必然是整数啊