0

Allright, while parsing a json object, the data of a key (length of 17 characters) is being modified. I assume it is rounding it which is an issue to me.

{
  "Content": "message",
  "User": 21576321584956327
}

I'm applying JSON.parse on it and the result is:

{
  Content: 'message',
  User: 21576321584956320
}

7 has become 0. I tried stringify on it but the result is: undefined

Nox
  • 17
  • 5
  • Don't store large sequences of digits as numbers, store them as strings. – user229044 May 04 '17 at 16:26
  • I tried to! But I do not control that. I cannot edit the fact that the numbers aren't coming as a string. – Nox May 04 '17 at 16:26
  • Then see https://stackoverflow.com/questions/18755125/node-js-is-there-any-proper-way-to-parse-json-with-large-numbers-long-bigint – user229044 May 04 '17 at 16:29

0 Answers0