浏览代码

保留两位小数

lichao 3 年之前
父节点
当前提交
5174c8f1ef
共有 1 个文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/views/index.vue

+ 1 - 2
src/views/index.vue

@@ -1004,7 +1004,6 @@ export default {
       this.profitData.xData = []
       this.profitData.seriesData = []
       getProfitData({pageSize: 24, pageNum: 1}).then(res => {
-        console.log(res)
         res.rows.forEach(item => {
           if (!item.shipsName) {
             item.shipsName = ''
@@ -1014,7 +1013,7 @@ export default {
           }
           let name = item.shipsName + '-' + item.voyage
           this.profitData.xData.push(name)
-          this.profitData.seriesData.push(Number(item.profit) / 10000)
+          this.profitData.seriesData.push((Number(item.profit) / 10000).toFixed(2))
           // this.profitData.seriesData.push(item.profit)
         })
         this.oceanVessel()