ALL,
I am trying to read the value of 1.5 from the initialization file and present it as 1.50000 in the text control in Windows Forms.
Here is the code:
string value = ini.Read( "Form", "value" );
this.textcontrol.Text = String.Format( "{0:F5}", value );
The “value” variable does contain 1.5 but the text control also shows 1.5 instead of 1.50000.
What am I doing wrong?
Thank you.
[EDIT]
As suggested I tried to do following:
var doublevar = double.Parse( value, CultureInfo.InvariantCulture );
this.textcontrol.Text = doublevar.ToString( "{0:F5}" );
but what I did see in the control is {1:F5}.
Any idea?
[/EDIT]
It should be like this
Here is more details String Format for Double [C#]