I am returning a decimal like '0.00000004177109' on API. When i prepare response on API Controller it is converting this decimal to it's scientific notation "4.177109e-8". This happens when i read response's content with ReadAsStringAsync or ReadAsStreamAsync , etc. I am getting same when i convert it to double. By the way , i am using Newtonsoft.JSON in json operations. Is there anybody else having same issue like this before ?
Here is the code snippet.
var response = task.GetAwaiter().GetResult();
var dd = response.Content.ReadAsStreamAsync().GetAwaiter().GetResult(); //When it reads , it is changing to scientific notation
StreamReader readStream = new StreamReader(dd);
var str = readStream.ReadToEnd();
str = str.Replace(); //Replacing something in readed content.
response.Content = new JsonContent(str);
return response;