li.shaoyi 2 月之前
父节点
当前提交
4695c05bdb
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/packages/mobile/views/pricing/trade/prepayment/Index.vue

+ 2 - 1
src/packages/mobile/views/pricing/trade/prepayment/Index.vue

@@ -186,7 +186,8 @@ const calcProfitLoss = (ratio: number, profitLoss: 1 | -1) => usedMargin.value.d
 // 计算价差
 const calcSpread = (value: number) => {
     const { agreeunit = 0 } = quote.value ?? {}
-    return value / (props.orderQty * agreeunit) * (props.orderType === 2 ? 1 : -1)
+    const absValue = Math.abs(value / (props.orderQty * agreeunit))
+    return (Math.ceil(absValue * 100) / 100) * (props.orderType === 2 ? 1 : -1)
 }
 
 // 盈亏比限制