Results 1 to 3 of 3

Thread: changing the 'f' at the end of a float number to 'F'

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Posts
    183

    changing the 'f' at the end of a float number to 'F'

    when my calculation outputs it provides an integer converted to a hex number, such as '000f' but I want it to output '000F' I'm sure that I could probably do it using a bitwise operator but have no idea how...

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Output the hex value to a string (using itoa() if necessary) and use the toupper() function on it. I think that's what it's called.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Frenzied Member Vlatko's Avatar
    Join Date
    Aug 2000
    Location
    Skopje, Macedonia
    Posts
    1,409
    If you are using printf then use the %X type character. That prints a hex number with big letters.
    I am become death, the destroyer of worlds.
    mail:[email protected]

    • Visual Basic 6.0 & .NET
    • Visual C++ 6.0 & .NET
    • ASP
    • LISP
    • PROLOG
    • C
    • Pascal

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width