Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何防止 jq 截断长十进制值?
例如:
echo '18302628978110292481' | jq .
结果:18302628978110292000
Javascript 不支持如此大的数字,因此也支持jq。整数大小为2^53。检查这个
jq
2^53
为了使其工作,您需要将它们视为字符串:
echo '"18302628978110292481"' | jq . # Prints "18302628978110292481"