C# .NET - string format two decimal places - Asked By raj on 27-Oct-15 08:38 AM

i need some one help to solve this problem. Here is my code. what i want is i want to print the value of
j as 12.60, here i declared the j as double and assigned it as 12.6
the result should be 12.60

            double   j = 12.6;
   
      MessageBox.Show(String.Format("{0:0.00}", j));
            when i execute it shows 12.60 correctly
 
     but when i  place it in label    it shows 12.6 only
     label1.Text = "Value is :"+string.Format("{0:0000.00}",j.ToString());

 
swetha reddy replied to raj on 01-Sep-15 07:39 AM
Convert.ToString("Value is" + string.Format("{0:00.00}", j));
Try this