Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Moving from ASP.Net Core 2.2 API to ASP.Net Core 3.1 API: decimals stopped showing decimal part

$
0
0

Hi,

I had an ASP.Net Core 2.2 Web API, with several GET operations where decimals always had the decimal part, even when the value of a property as 0.

Now I've changed the target framework to .Net Core 3.1 and some decimals (not all) began output without the separator and the decimal part. This is strange because there are some properties that do this, and others that kept showing the separator and the decimal part.

Practical example:

Before:

{"price": 13.00,"quantity: 0.0
}

After:

{"price": 13.00,"quantity: 0
}

Notice quantity property.

On the 2.2 version, I didn't have any kind of configuration on startup or whatsoever that would treat decimals differently.

This doesn't seem to be critical or error, but it's different. And I'm curious, why some properties it cuts the separator and the decimal part, and others fills decimal part like it was doing before?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>