简体   繁体   中英

Net Core request model changes decimal values

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.

角

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

网络核心

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM