li.shaoyi há 2 meses atrás
pai
commit
4695c05bdb

+ 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)
 }
 
 // 盈亏比限制