Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Convert from hex string to decimal string

Convert from hex string to decimal string

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 5.1k Views 2 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.
  • McLionM Offline
    McLionM Offline
    McLion
    wrote on last edited by
    #1

    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
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #2

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

      McLionM 1 Reply Last reply
      0
      • mrjjM mrjj

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

        McLionM Offline
        McLionM Offline
        McLion
        wrote on last edited by
        #3

        @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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved