0

I have a web api which is returning a list(each item consists of bit values). But when I see response from client side in console, I found that the bit value is changed.

For example if I have 36028797018963968 bit value in database then it is changed to 36028797018963970.

This is happening only for this bit value. In a list of 5 values only the above mentioned value is changing. The remaining are coming fine.

I have never seen this type of behaviour before, so I am not sure what else I should be posting here. Ask me if you need anything else.

Mounika
  • 41
  • 1
  • 7
  • How is the data being transferred? json? are you converting the value from string to integer or something? – Kevin B Aug 26 '15 at 14:35
  • @Kevin B The data is being transferred as json. I am not converting it anywhere. The value is of type long in my API. When I put a log in my ajax success call I am getting this wierd values. Now when I try parsing the data into XML it is working fine. I don't understand why it didn't work before when I am returning it in json. xmlDoc = $.parseXML(data); – Mounika Aug 31 '15 at 05:36

1 Answers1

0

There is no limitation for integer values in Json. But Javascript has boundaries.

JSON transfer of bigint: 12000000000002539 is converted to 12000000000002540?

Community
  • 1
  • 1
Vamsy
  • 144
  • 4
  • 16