I have an object with an attribute defined as long and the exact value is 635980054734850470
but when it gets serialised the JSON output gives me 635980054734850400
It seems to be consistently dropping the last two digit values, rather than giving me the exact, value. Is there any reason for this?
Here's the example C# code:
[Route("/timestamp", Verbs = "GET")]
public class GetTimestamp : IReturn<TimestampData>
{
}
public class TimestampData
{
public long Timestamp { get; set; }
}
public class TimestampService : CustomerServiceBase
{
public object Get(GetTimestamp request)
{
var timestamp = DateTime.UtcNow.Ticks;
Console.WriteLine(timestamp);
return new TimestampData() { Timestamp = timestamp };
}
}
Sample output:
{"Timestamp":635984646884003500}
Notice the output always rounds to the nearest 100.