Click to See Complete Forum and Search --> : Urgent- conversion .Please help


DanielaTm
March 31st, 2006, 01:21 AM
Hi,
I have a problem. I used to convert an object to double like this:
System.Double val = Convert.ToDouble(valeur, culture);
function of culture.
Now I have as object un array of double...
how can I make the conversion??I don't have Convert.To...?

Thanks

swamivishal1
March 31st, 2006, 03:34 AM
Hi,
I have a problem. I used to convert an object to double like this:
System.Double val = Convert.ToDouble(valeur, culture);
function of culture.
Now I have as object un array of double...
how can I make the conversion??I don't have Convert.To...?

Thanks


you will need to create a different array of double then with a loop transfer elements one by one in the new array ; hope this will help :wave:

Tom_Hirst
March 31st, 2006, 05:47 AM
Now I have as object un array of double...


Do you mean you have an object (scalar), which holds an array of doubles, or do you have an array of objects, each of which holds a double?

If it's the first case, then you could just cast it, in the second case I would create an array of doubles of equal size and loop through, converting each element individually.

qimini
April 2nd, 2006, 09:18 PM
Array.Copy method maybe fit

DanielaTm
April 3rd, 2006, 02:17 AM
Yes, it was helpfull. I had to convert every element of the array.
Thanks again