Wednesday 19 October 2011

Convert String

my data return string (always 9 character) as following,
000005330
000004110
000041660
how my GridView display above value into decimal. the expected result as following,
53.30
41.10
416.60
------------------------
Sample solution
  string a = "000005330";

            a = a.Insert(a.Length - 2, ".");

            float num = float.Parse(a);

No comments:

Post a Comment