Procházet zdrojové kódy

价差,有效价差保留位数

laiguoran před 5 roky
rodič
revize
45fc614d6b
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      app/public/js/material.js

+ 2 - 2
app/public/js/material.js

@@ -187,12 +187,12 @@ $(document).ready(() => {
     const materialCol = {
         getValue: {
             msg_spread: function (data) {
-                return ZhCalc.round(ZhCalc.sub(data.msg_tp, data.basic_price), 2);
+                return ZhCalc.round(ZhCalc.sub(data.msg_tp, data.basic_price), 3);
             },
             m_spread : function (data) {
                 const msg_spread = materialCol.getValue.msg_spread(data);
                 const cor = msg_spread >= 0 ? ZhCalc.mul(data.basic_price, ZhCalc.div(data.m_up_risk, 100)) : ZhCalc.mul(data.basic_price, ZhCalc.div(data.m_down_risk, 100));
-                return Math.abs(msg_spread) > Math.abs(cor) ? (msg_spread > 0 ? ZhCalc.round(ZhCalc.sub(msg_spread, cor), 2) : ZhCalc.round(ZhCalc.add(msg_spread, cor), 2)) : 0;
+                return Math.abs(msg_spread) > Math.abs(cor) ? (msg_spread > 0 ? ZhCalc.round(ZhCalc.sub(msg_spread, cor), 3) : ZhCalc.round(ZhCalc.add(msg_spread, cor), 3)) : 0;
             },
             m_tp: function (data) {
                 return ZhCalc.round(ZhCalc.mul(materialCol.getValue.m_spread(data), data.quantity), 2);