Browse Source

合约盘口小数点处理

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

8
src/views/contract/handicap.vue

@ -172,7 +172,9 @@ export default {
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);
item.total = item.total.toFixed(3)
}); });
return list.reverse(); return list.reverse();
}, },
@ -180,7 +182,9 @@ export default {
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