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. conversion from string to binary to decimal

conversion from string to binary to decimal

Scheduled Pinned Locked Moved C#
8 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.
  • P Offline
    P Offline
    Pankaj Garg
    wrote on last edited by
    #1

    is there any way to convert the string to binary and subsequently to decimal.

    If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

    V C 2 Replies Last reply
    0
    • P Pankaj Garg

      is there any way to convert the string to binary and subsequently to decimal.

      If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

      V Offline
      V Offline
      Vikram A Punathambekar
      wrote on last edited by
      #2

      Is Google[^] not working?

      Cheers, Vikram.


      Zeppelin's law: In any Soapbox discussion involving Stan Shannon, the probability of the term "leftist" or "Marxist" appearing approaches 1 monotonically. Harris' addendum: I think you meant "monotonously". Martin's second addendum: Jeffersonian... I think that should at least get a mention.

      P 1 Reply Last reply
      0
      • V Vikram A Punathambekar

        Is Google[^] not working?

        Cheers, Vikram.


        Zeppelin's law: In any Soapbox discussion involving Stan Shannon, the probability of the term "leftist" or "Marxist" appearing approaches 1 monotonically. Harris' addendum: I think you meant "monotonously". Martin's second addendum: Jeffersonian... I think that should at least get a mention.

        P Offline
        P Offline
        Pankaj Garg
        wrote on last edited by
        #3

        i am asking this question because out of (02 , 1 , 1a) both are string type values , how should i ascertain programatically which is bigger(I mean , how to align them in ascending order)? I thought , first i should convert the string to binary and subsequently to decimal. Am I doing right ?

        If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

        M 1 Reply Last reply
        0
        • P Pankaj Garg

          is there any way to convert the string to binary and subsequently to decimal.

          If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          if you convert to a number, it will be a number, it won't be binary or decimal. Those are rendering details. int.TryParse turns a string to an int.

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          P 1 Reply Last reply
          0
          • C Christian Graus

            if you convert to a number, it will be a number, it won't be binary or decimal. Those are rendering details. int.TryParse turns a string to an int.

            Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

            P Offline
            P Offline
            Pankaj Garg
            wrote on last edited by
            #5

            can u suggest me a logic regarding the list 1 , 11 , 2 ,aa , 1a to align in the ascending order ?

            If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

            C 1 Reply Last reply
            0
            • P Pankaj Garg

              can u suggest me a logic regarding the list 1 , 11 , 2 ,aa , 1a to align in the ascending order ?

              If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              Are these hex numbers ? I guess write a sort routine to turn them into numbers and sort from there.

              Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

              1 Reply Last reply
              0
              • P Pankaj Garg

                i am asking this question because out of (02 , 1 , 1a) both are string type values , how should i ascertain programatically which is bigger(I mean , how to align them in ascending order)? I thought , first i should convert the string to binary and subsequently to decimal. Am I doing right ?

                If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

                M Offline
                M Offline
                mabo42
                wrote on last edited by
                #7

                Read this article: http://www.codeproject.com/KB/recipes/csnsort.aspx[^]

                P 1 Reply Last reply
                0
                • M mabo42

                  Read this article: http://www.codeproject.com/KB/recipes/csnsort.aspx[^]

                  P Offline
                  P Offline
                  Pankaj Garg
                  wrote on last edited by
                  #8

                  Today , i wrote the code , for sorting the datatable according to the decimal type column or string type column.All i have to do is to pass the datatable and the column number according to which one has to sort. I want to improve the code. Should i display it here ?

                  If you have an apple & I have an apple and we exchange our apples, then each of us will still have only one apple but if you have an idea & I have an idea and we exchange our ideas, then each of us will have two ideas!

                  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