Parse it:
double d;
if (double.TryParse(campi[14], out d))
{
string s = d.ToString();
...
}
If you can, use the double value instead of the string, and look at the definitions in your DB - you shouldn't be storing values as strings (or you need a better way of retrieving values if you are storing them numerically)
"Thank you for your answer. Using your code, output isn't correct.
For example, my first data for campi[14] is 0000000000000004.97.
If i using your code the variable "d" become 497.0 and "s" 497.
My output must to is 4.97.
And, if some price start with 0 like this 000000000000000.97 , I want to became 0.97"
Except...you didn't bother to try it, did you?
string[] campi = new string[15];
double d;
campi[14] = "0000000000000004.97";
if (double.TryParse(campi[14], out d))
{
string s = d.ToString();
Console.WriteLine("{0}:{1}", d, s);
}
campi[14] = "000000000000000.97";
if (double.TryParse(campi[14], out d))
{
string s = d.ToString();
Console.WriteLine("{0}:{1}", d, s);
}
Gives the output:
4.97:4.97
0.97:0.97
Which is exactly what you asked for...