Net Core request model changes decimal values

198 Views Asked by At

When sending a request model to Net Core API from Angular app, it changes the floating point variable's value.

Here is the request body sent from Angular app.

Angular

And when it hits the net core api it changes to this.

Net Core

The problem can be fixed by rounding in this case but I wonder if it will have harming affects with other values.

1

There are 1 best solutions below

0
On

It seems like Quantity has double type. Change it to decimal in order to precisely represent decimal values.