【前端】后端返回超长数字时network显示1e+21的解决办法

直接上代码,关键函数new Number(row.price).toLocaleString()

let response = await request({
  url: "http://localhost:9999/xxx/xxx/getBigInteger?status=0",
  method: "GET",
  params: null,
  data: null
})
console.log(response)
console.log("============================================")
console.log(new Number(response.data).toLocaleString())

猜你喜欢

转载自blog.csdn.net/qq_37928038/article/details/128921635