How to designate decimal points to be displayed when using Convert.ToString
.NET (Core and Framework)
2
Posts
2
Posters
0
Views
1
Watching
-
I have a double value, which I am converting to a string. When it is 0, I would like display it as 0.0 to indicate to the user that the value is a floating point number. Alas, Convert.ToString(myDouble) returns "0" How can I affect the output of Convert.ToString? Thanks
-
I have a double value, which I am converting to a string. When it is 0, I would like display it as 0.0 to indicate to the user that the value is a floating point number. Alas, Convert.ToString(myDouble) returns "0" How can I affect the output of Convert.ToString? Thanks
I never use Convert. Take a look at
myDouble.ToString ( "#.0##" )