收藏
回答

发现一个json解析的bug

{"id":180305191446086569,"numgoods":1,"numpiece":1,"goods":[{"id":1463800084,"num":1}],"goodids":[1463800084],"type":0,"subject":"参会票","summary":"1 x 参会票(1.00)","currency":"CNY","amount":100,"discount":0,"offamount":0,"dealamount":100,"paysource":0,"payamount":0,"paystatus":0,"paytime":0,"refundsource":0,"refundamount":0,"refundstatus":0,"refundtime":0,"couponid":0,"promosid":0,"cellphone":"18610109155","realname":"songyang","email":"","title":"","corp":"","telephone":"","address":"","zipcode":"","invoicetype":0,"invoicetitle":"","invoicememo":"","usermemo":"","adminmemo":"","source":1467721217,"orgid":1467721003,"uid":1442626999,"cuid":1442626999,"rcmduid":0,"status":0,"ctime":1520248856,"mtime":1520248856,"code":0,"msg":"成功"}


这个字符串,通过json解析后id变成:180305191446086560


应该是解析精度问题


最后一次编辑于  2018-03-05  (未经腾讯允许,不得转载)
邀请回答
复制链接收藏关注问题回答

2 个回答

  • YihLeego
    YihLeego
    2018-03-05

    只能暂时改成字符串了

    路过

    2018-03-05
    赞同
    回复
  • f番茄花园
    f番茄花园
    2018-03-07

    js的number都是8位浮点数

    你的id解析成数字有什么特殊意义吗?没有就用字符串

    2018-03-07
    赞同
    回复