Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. System.Convert.ToDouble(stringVal)

System.Convert.ToDouble(stringVal)

Scheduled Pinned Locked Moved C#
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dec82
    wrote on last edited by
    #1

    What differences between: double num= System.Convert.ToDouble(stringVal); double num= Convert.ToDouble(stringVal); Thanks!

    J L realJSOPR 3 Replies Last reply
    0
    • D dec82

      What differences between: double num= System.Convert.ToDouble(stringVal); double num= Convert.ToDouble(stringVal); Thanks!

      J Offline
      J Offline
      John Gathogo
      wrote on last edited by
      #2

      No difference actually. System is almost always automatically added in "using" section.

      1 Reply Last reply
      0
      • D dec82

        What differences between: double num= System.Convert.ToDouble(stringVal); double num= Convert.ToDouble(stringVal); Thanks!

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2790732

        1 Reply Last reply
        0
        • D dec82

          What differences between: double num= System.Convert.ToDouble(stringVal); double num= Convert.ToDouble(stringVal); Thanks!

          realJSOPR Offline
          realJSOPR Offline
          realJSOP
          wrote on last edited by
          #4

          The first example guarantees that the .Net version of Convert.ToDouble will be used. The second one will use the locally defined version if you've written one, and if not, will use the one defined in the System namespace. Most programmers don't bother qualifying the Convert object, and just use the 2nd example.

          "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
          -----
          "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups