Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Convert from hex string to decimal string

    General and Desktop
    2
    3
    3174
    Loading More Posts
    • 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.
    • McLion
      McLion last edited by

      Is there an easy way to convert from a string containing a hex value like
      "0A02"
      to a string with its decimal value:
      "2562"

      1 Reply Last reply Reply Quote 0
      • mrjj
        mrjj Lifetime Qt Champion last edited by mrjj

        Hi
        somehing like
        http://doc.qt.io/qt-5.5/qstring.html#toUInt
        with base=16, maybe ?

        McLion 1 Reply Last reply Reply Quote 0
        • McLion
          McLion @mrjj last edited by

          @mrjj
          .. returns an uint ... and then reconvert to a string ?
          OK, that of course works in 2-steps. I was wondering if there is something like a 1-step conversion.
          Thanks anyway

          1 Reply Last reply Reply Quote 0
          • First post
            Last post