How do I prevent my double value from being rounded when converting to a string? I have tried both Convert.ToString and ToString() with the same result.
For example my double may look something like 77.987654321, and the two strings conversions convert to to 77.98765. I need to keep the precision of the value as is.
By default the
.ToString()method ofDoublereturns 15 digits of precision. If you want the full 17 digits that the double value holds internally, you need to pass the “G17” format specifier to the method.Sourced from the MSDN docs: