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
Forum Updated to NodeBB v4.3 + New Features

Convert from hex string to decimal string

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 4.8k 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.
  • M Offline
    M Offline
    McLion
    wrote on 25 Jan 2016, 13:27 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
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 25 Jan 2016, 13:41 last edited by mrjj
      #2

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

      M 1 Reply Last reply 25 Jan 2016, 13:45
      0
      • M mrjj
        25 Jan 2016, 13:41

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

        M Offline
        M Offline
        McLion
        wrote on 25 Jan 2016, 13:45 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

        1/3

        25 Jan 2016, 13:27

        • Login

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