The Solution 1 and 2 are correct. In most cases, you don't need to output value in its default format.
First of all, you assign a double value to a string property. Such assignment makes no sense in .NET, but VB.NET provides "automatic" work-around by assigning not double value, but
double.ToString()
, which is actually a bad thing; it would be much better it if issued a compilation error instead, as it is normally done.
You should always use
ToString
, which also allows you, in other forms of this function, to provide culture, format string, of both. Please see:
http://msdn.microsoft.com/en-us/library/system.double.tostring.aspx[
^].
For format strings and their effect, please see:
http://msdn.microsoft.com/en-us/library/dwhawy9k.aspx[
^],
http://msdn.microsoft.com/en-us/library/0c899ak8.aspx[
^].
—SA