consider I have this value ..
2.4
how do I format this using String.Format or any other way in my aspx page so it prints 2.4 but when the value is 2.0 it only prints 2 ??
Printable View
consider I have this value ..
2.4
how do I format this using String.Format or any other way in my aspx page so it prints 2.4 but when the value is 2.0 it only prints 2 ??
Try {0:g}
that did not work.
.ToString("#.0")
Does not work.
Can you be a little more vague? :afrog:Quote:
Originally Posted by chocoloco
(String.Format("{0:g}", Convert.ToDouble("2.000")))
That worked. thanksQuote:
Originally Posted by mendhak
What were you trying the first time?
Didn't do Convert.ToDoubleQuote:
Originally Posted by mendhak