Dec2Hex ( theNumber ; num0s )
Convert Decimal # to Hex Text
Average rating: 3.9 (41 votes) Log in to vote
Samuel Herschbein - Show more from this author
Comsultant http://www.oz.net/~samh |
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
This custom function requires my other function, listed here only for convenience:
Dec2HexNoLeading0s ( theNumber )
Let (
// get the hex digit for the least significant nibble (4 bits)
thisNibble = Middle ( "0123456789ABCDEF" ; Mod (theNumber ; 16) + 1 ; 1 ) ;
// see if theNumber passed is bigger than a nibble, if so recurse to process the more significant nibbles
If ( theNumber < 16 ;
"" ; // blank means we're not adding any extra
Dec2HexNoLeading0s ( Int ( theNumber / 16 ) ) // add the more significant nibbles
) &
thisNibble // always return the least significant nibble
)
Comments
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.