CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2006
    Location
    Graz, Austria
    Posts
    273

    Urgent- conversion .Please help

    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
    Daniela
    ******
    I would love to change the world, but they won't give me the source code

  2. #2
    Join Date
    Jan 2004
    Location
    Noida,India
    Posts
    96

    Re: Urgent- conversion .Please help

    Quote Originally Posted by DanielaTm
    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
    A small First step is the begining of any giant leap

  3. #3

    Re: Urgent- conversion .Please help

    Quote Originally Posted by DanielaTm
    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.

  4. #4
    Join Date
    Feb 2004
    Posts
    3

    Re: Urgent- conversion .Please help

    Array.Copy method maybe fit

  5. #5
    Join Date
    Mar 2006
    Location
    Graz, Austria
    Posts
    273

    Re: Urgent- conversion .Please help

    Yes, it was helpfull. I had to convert every element of the array.
    Thanks again
    Daniela
    ******
    I would love to change the world, but they won't give me the source code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured