GrandAlf
Advanced Member level 2
bcd2hex
I feel rather foolish, but cannot seem to my head round this one. I am trying to convert base 16 numbers (no letters A-F used) to base 10 as per the following.
B16 0x47 = Dec 71. B16 0x16 = Dec 22. B16 0x30 = Dec 48. B16 0x01 = Dec 1 Etc
Anyone got a routine for doing this?. As I said none of the B16 numbers contain any hex characters, all are standard numbers. Seems so obvious, but I just have a blind spot here. Can obviously display in any format using printf, but this is not what I am after. Any advice most gratefully received.
I feel rather foolish, but cannot seem to my head round this one. I am trying to convert base 16 numbers (no letters A-F used) to base 10 as per the following.
B16 0x47 = Dec 71. B16 0x16 = Dec 22. B16 0x30 = Dec 48. B16 0x01 = Dec 1 Etc
Anyone got a routine for doing this?. As I said none of the B16 numbers contain any hex characters, all are standard numbers. Seems so obvious, but I just have a blind spot here. Can obviously display in any format using printf, but this is not what I am after. Any advice most gratefully received.