Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Algorithm for converting hex-string in dec-string.
Message
From
07/05/2002 07:57:41
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
07/05/2002 07:51:23
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00653419
Message ID:
00653422
Views:
19
>I would like to know if somebody knows a algorithm that does the following.
>
>given: hex_string="0462E62fcf"

There is some built-in conversion, which I don't remember now. Transform can convert the other way.

If you want to do the conversion yourself, multiply the rightmost digit by 1, the second from the right by 16, the third from the right by 16^2, etc.

Shortcut, without powers: Multiply the first digit by 16, add the next digit, multiply the result by 16 again, add the next digit, etc.

Don't forget that A = 10, B = 11, ... F = 15.

HTH, Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform