【发布时间】:2020-11-13 09:44:46
【问题描述】:
我正在接收数据,
{
"balance": 1e+22
}
我想要它,
{
"balance": 10000000000000000000000
}
我应该怎么做才能在 Node API 中获得正确的响应值?
【问题讨论】:
标签: api numbers decimal converters exponential
我正在接收数据,
{
"balance": 1e+22
}
我想要它,
{
"balance": 10000000000000000000000
}
我应该怎么做才能在 Node API 中获得正确的响应值?
【问题讨论】:
标签: api numbers decimal converters exponential
找到的解决方案:How to avoid scientific notation for large numbers in JavaScript?
作为完美解决方案的代码:BigInt(n).toString();
【讨论】: