March 23, 200421 yr Does anyone know an easy calc formula to convert decimal into hex numbers? Version: v6.x Platform: Mac OS 9
March 23, 200421 yr Here is a FMI tech article that may help. http://www.filemaker.com/ti/102254.html Lee
March 23, 200421 yr This will work for up to 32 bit numbers. And I came up with it before I read the tech article... Sometimes being an old bit-banger actually helps! This version is the instructional version, substitute the actual 2^x numbers to make it execute faster. Middle("0123456789ABCDEF", Mod( Int(theInteger / 2^28), 2^4) + 1, 1) & Middle("0123456789ABCDEF", Mod( Int(theInteger / 2^24), 2^4) + 1, 1) & Middle("0123456789ABCDEF", Mod( Int(theInteger / 2^20), 2^4) + 1, 1) & Middle("0123456789ABCDEF", Mod( Int(theInteger / 2^16), 2^4) + 1, 1) & Middle("0123456789ABCDEF", Mod( Int(theInteger / 2^12), 2^4) + 1, 1) & Middle("0123456789ABCDEF", Mod( Int(theInteger / 2^8), 2^4) + 1, 1) & Middle("0123456789ABCDEF", Mod( Int(theInteger / 2^4), 2^4) + 1, 1) & Middle("0123456789ABCDEF", Mod( theInteger, 2^4) + 1, 1) For those who don't know: a bit-banger is someone who worked on computers with front panel switches and lights (for each bit). The switches allowed data and instructions to be entered and the processor to be stopped, started, and single stepped through instructions. Many were the hours spent debugging operating systems & hardware... Fond memories of my Data General Nova and Teletype ASR-33.
March 24, 200421 yr Author just what the doctor ordered - thank you! i'll take a look at the teech articel also. bitbanger... i love it :-)
April 11, 200421 yr Author i thought i could just reverse the logic to make decimals from hex numbers. seems to be more involved. is there another formula that can do it or would i need to script it to convert one digit at a time?
April 12, 200421 yr This will give you the decimal value of a hex number that's up to 8 digits long: (((((((( (Position("0123456789ABCDEF",Middle(Right("00000000"&TheHexNumber,8),1,1),1,1 )-1))*16+ (Position("0123456789ABCDEF",Middle(Right("00000000"&TheHexNumber,8),2,1),1,1 )-1))*16+ (Position("0123456789ABCDEF",Middle(Right("00000000"&TheHexNumber,8),3,1),1,1 )-1))*16+ (Position("0123456789ABCDEF",Middle(Right("00000000"&TheHexNumber,8),4,1),1,1 )-1))*16+ (Position("0123456789ABCDEF",Middle(Right("00000000"&TheHexNumber,8),5,1),1,1 )-1))*16+ (Position("0123456789ABCDEF",Middle(Right("00000000"&TheHexNumber,8),6,1),1,1 )-1))*16+ (Position("0123456789ABCDEF",Middle(Right("00000000"&TheHexNumber,8),7,1),1,1 )-1))*16+ (Position("0123456789ABCDEF",Middle(Right("00000000"&TheHexNumber,8),8,1),1,1 )-1)) The field "TheHexNumber" must be text.
Create an account or sign in to comment