Jump to content
Server Maintenance This Week. ×

Hex Calculation


This topic is 8487 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Middle("0123456789ABCDEF",1+ Mod(Int(DecNum/16/16/16),16), 1) &

Middle("0123456789ABCDEF",1+ Mod(Int(DecNum/16/16),16), 1) &

Middle("0123456789ABCDEF",1+ Mod(Int(DecNum/16),16), 1) &

Middle("0123456789ABCDEF", 1+Mod(DecNum,16), 1)

... where DecNum is the decimal number you want to convert. This will handle up to 65535 decimal or FFFF hex. If you need more digits, just append more terms on the beginning of the calculation. Add an additional /16 for each one.

[This message has been edited by BobWeaver (edited February 02, 2001).]

Link to comment
Share on other sites

(((Position("0123456789ABCDEF", Upper(Middle(HexNum, 1, 1)), 1, 1)-1)*16+

Position("0123456789ABCDEF", Upper(Middle(HexNum, 2, 1)), 1, 1)-1)*16+

Position("0123456789ABCDEF", Upper(Middle(HexNum, 3, 1)), 1, 1)-1)*16+

Position("0123456789ABCDEF", Upper(Middle(HexNum, 4, 1)), 1, 1)-1

Link to comment
Share on other sites

This topic is 8487 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.