I am sending JSON from the server to client side. The JSON contains a long
.
It appears that the number is being rounded or something because:
- The server side number sent is:
1036647050030089506
- The client side number received is:
1036647050030089500
Why is this happening and how can I fix this?
Server side code:
Post["team", true] = async (parameters, ct) =>
{
var team = this.Bind<Team>();
team.Id = 1036647050030089506;
Console.WriteLine("Response: " + team.Id);
return Response.AsJson(team);
};
Client side code:
$.ajax({
url: '/api/team',
type: 'POST',
dataType: "json",
success: function (response) {
alert("Response: " + response.id);
}
});