@@ -13,7 +13,8 @@ export const useProfitloss = (record: QueryTradePositionRsp) => {
if (lastPrice !== '--') {
const { averageprice, decimalplace, agreeunit, curpositionqty, buyorsell } = record;
const temp = buyorsell === BuyOrSell.buy ? 1 : -1
- return ((+lastPrice - averageprice) * curpositionqty * agreeunit * temp).toFixed(decimalplace);
+ const result = ((+lastPrice - averageprice) * curpositionqty * agreeunit * temp).toFixed(2);
+ return result === '-0' ? '0' : result
} else {
return lastPrice;
}