0

My problem is reading big numbers such as 999999999999999999 from the server. I mean I send a $http request and as response I receive a JSON object which includes a field as I told before.

But the value is completely ruined, it is like this 1000000000000000000 and I couldn't find any way to access the current data in my code for example interceptors for request or something like that did not work for me.

My code is based on javascript, angular1 and jquery.

what is the solution, any idea would be appreciated.

Md Johirul Islam
  • 5,042
  • 4
  • 23
  • 56
  • Do you need to do some math on them. If you don't you can just use them as strings – Luca Regazzi Feb 04 '18 at 07:38
  • @LucaRegazzi No! I really don't need to do any math on them! But right now server sends the value in integer format, I wanted to make sure that there is no good way to manage it at client before ask them to change their way. – user2815272 Feb 04 '18 at 07:59
  • [Modify the JSON string to encode your numbers as strings before passing the JSON to `JSON.parse`.](https://stackoverflow.com/a/47916876/9029328) – AuxTaco Feb 04 '18 at 09:15

0 Answers0