After making a network call, the backend is sending the following data:
"uom" : "EA",
"qty" : 1.123456789012345678
However, when this information reaches the frontend and is logged using console.log:
{
qty: 1.1234567890123457,
uom: "EA"
}
Why does it appear that JavaScript is either losing the last digit of the number or truncating it?
In Java, the number is represented using BigDecimal. The front end uses AngularJs framework and makes a GET request to the backend for a JSON response.