Shop OBEX P1 Docs P2 Docs Learn Events
Displaying large hex on screen — Parallax Forums

Displaying large hex on screen

ArchiverArchiver Posts: 46,084
edited 2002-01-30 21:41 in General Discussion
Hi,

I would be grateful for some help.

I have a largish hex number ... 010DCB6B hex

which equals Decimal 17681259.

This number could in the practical situation be up to 8 bytes long
always delivered in Hex.

Meantime though I would like to display the decimal equivalent
ie 17681259 on screen using debug or serout.

how can I do this ?

If I use the multiply * & multiply high ** function I end up with
two decimal numbers but when put back together they are NOT
17681259.

thanks

Barney

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2002-01-30 21:41
    Hi Barney,

    This URL describes one way to parse double precision numbers for display:

    http://www.emesys.com/BS2math6.htm#showdubdec

    It kicks out decimal digits by taking remainders from successive
    divisions by 10 or 100.

    -- regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...



    >Hi,
    >
    >I would be grateful for some help.
    >
    >I have a largish hex number ... 010DCB6B hex
    >
    >which equals Decimal 17681259.
    >
    >This number could in the practical situation be up to 8 bytes long
    >always delivered in Hex.
    >
    >Meantime though I would like to display the decimal equivalent
    >ie 17681259 on screen using debug or serout.
    >
    >how can I do this ?
    >
    >If I use the multiply * & multiply high ** function I end up with
    >two decimal numbers but when put back together they are NOT
    >17681259.
    >
    >thanks
    >
    >Barney
Sign In or Register to comment.