newtonsoft json.net disable scientific notation
Asked Answered
E

0

10

I would like my webapi to serialize json using camelcase. So i added the following to Global.asax.

        HttpConfiguration config = GlobalConfiguration.Configuration;
        config.Formatters.JsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
        config.Formatters.JsonFormatter.UseDataContractJsonSerializer = false;

What i noticed is that because i set UseDataContractJsonSerializer to false, big decimals are serialized using scientific notation. How can i keep camelcase and at the same time disable scientific notation ?

Thanks

Elegy answered 9/1, 2020 at 13:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.