Open feeleen opened 1 year ago
Nice catch.
It's definitely not desired nor sensible behavior. If the json converter does not apply, then the value should be processed as if the json converter simply isn't there...
maybe there is some unnecessary conversion to double when using attribute?
It very much seems so, because you can influence the behavior by setting the FloatParseHandling setting to FloatParseHandling.Decimal (https://dotnetfiddle.net/beqQAh). This could count as a workaround, but in my subjective opinion it should not be an expected nor required usage pattern to do such seemingly arbitrary adjustments to the serialization settings in an attempt to achieve consistency in deserialization behavior.
https://dotnetfiddle.net/tnL06K
Result is: Bad: 100000000, Good: 99999999.99999999
Bad is rounded, but Good is not. only difference is that Bad has converter attribute, which doesnt do any work here maybe there is some unnecessary conversion to double when using attribute?
is this a bug? is there any workaround?