后台返回的数据中有数据库里为long型的属性,在用json.parse格式化时发现这些数字的后几位精度都有偏差,如何处理这种情况?
让后台返回long数据用字符串,前台接收后用BigInt去接字符串
所有非int4类型数字(int8, numeric,long,float, double, bigint 等)在传输时都应该以string格式存储。
CNode 社区为国内最专业的 Node.js 开源技术社区,致力于 Node.js 的技术研究。
让后台返回long数据用字符串,前台接收后用BigInt去接字符串
所有非int4类型数字(int8, numeric,long,float, double, bigint 等)在传输时都应该以string格式存储。