Math.Round((ClosePrice - OpenPrice), 5) = -0.00001
But When I convert it into tostring it gives "-1E-05"
Math.Round((ClosePrice - OpenPrice), 5).ToString() = "-1E-05"
Why this is so ? How can I get "-0.00001"
You can use format specifier as demonstrated on MSDN's Standard Numeric Format Strings
double foo = -0.00001;
Console.WriteLine(foo.ToString("f5"));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With