How to add string value and format it with decimal places using Custom Numeric Format Strings in ASP.Net

Last Reply on Feb 17, 2017 11:15 PM By Shashikant

Posted on Feb 17, 2017 11:14 PM

I have two values

string ti=05.00

string add=09.00

 I have to convert the string to double because i want to add the twovalues.

 double value1 = Convert.ToDouble(ti);

double value2 = Convert.ToDouble(add);

When i convert the values become

Value1=5.0

value2=9.0

 

But i want the 

value1 =05.00

value2=09..00

Posted on Feb 17, 2017 11:15 PM

Please refer below link

https://msdn.microsoft.com/en-us/library/0c899ak8(v=vs.110).aspx

I hope this will help you out.