Browse Source

合约盘口小数点处理

master
luyisha 3 years ago
parent
commit
e53f38639e
  1. 18
      src/views/contract/handicap.vue

18
src/views/contract/handicap.vue

@ -169,18 +169,22 @@ export default {
}; };
}, },
sellListShow() { sellListShow() {
let list = this.sellList.splice(0, 12); let list = this.sellList.splice(0, 12);
let total = 0; let total = 0;
list.forEach(item => { list.forEach(item => {
item.total = total += item.amount; // item.total = total += item.amount;
}); item.total = total += Number(item.amount);
return list.reverse(); item.total = item.total.toFixed(3)
});
return list.reverse();
}, },
buyListShow() { buyListShow() {
let list = this.buyList.splice(0, 12); let list = this.buyList.splice(0, 12);
let total = 0; let total = 0;
list.forEach(item => { list.forEach(item => {
item.total = total += item.amount; // item.total = total += item.amount;
item.total = total += Number(item.amount);
item.total = item.total.toFixed(3);
}); });
return list; return list;
} }

Loading…
Cancel
Save