Hello I have a double value like this in VB.NET:
Dim value = 9.729000000000001
When converting to string, I get this:
value.tostring() "9.729"
I try to add formatting:
value.tostring("0.00000000000000")
But it did not work (I lose the ending 1).
How can I keep all of my digits?
This is documented here and here
Try this
Dim value As Double = 9.729000000000001
Dim strText As String = value.ToString("G17")
Or this
Dim value As Double = 9.729000000000001
Dim strText As String = value.ToString("R")
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