NumToHex ( integer )
Rate this function: Average rating: 3.7 (18 votes) Discuss this Custom Function
Jeremiah Small, Soliant Consulting
http://jsmall.us
Convert Base 10 number to Base 16
Sample Input:
|
Sample Output:
|
Description:
To convert a base 10 number to hexadecimal you repeatedly divide the number by 16, each time recording the remainder. At the end of this line up all of the remainders and reverse their order. As you know, hexadecimal is base 16, and hence makes use of 6 extra symbols (ABCDEF). A = 10, and F, 15. 16 is written as 10. When converting to any base above 10 a remainder equal to or greater than 10 has to be written using the correct symbol.
Similar to
Example:
Converting 3440 to hexadecimal
3440/16 = 215 (Mod = 0dec or 0hex)
215/16 = 13 (Mod = 7dec or 7hex)
13/16 = 0 (Mod = 13dec or Dhex)
In reverse order, the hex reads D70
Hence, 3440dec = D70hex
Note: these functions are not guaranteed
or supported by BrianDunning.com. Please contact the individual
developer with any questions or problems.
This is my Custom Function and I want to
edit it
Discuss:There are no comments yet. Be the first to post a comment about this Custom Function! Please try to keep it brief & to the point. Anyone can post:
|
Newest Custom Functions:
| 1. |
CountWordOccurrences ( text ; searchWord ) |
| |
(Tue, Feb 07, 11:15am) |
| 2. |
indonesian_date(date) |
| |
(Mon, Feb 06, 7:14pm) |
| 3. |
phpArrayValue ( array ; key ; pos ) |
| |
(Fri, Jan 27, 1:49pm) |
| 4. |
solfm_timeToMinutes (theTime;roundSec) |
| |
(Fri, Jan 20, 6:26am) |
| 5. |
filterLines(filterField;filterValue;Result) |
| |
(Sat, Jan 14, 2:20pm) |
| 6. |
getMaxValue ( theList ) |
| |
(Thu, Jan 12, 1:06pm) |
| 7. |
MiddleWordsIncPunct ( text ; startingWord ; numberOfWords ) |
| |
(Sat, Jan 07, 9:16am) |
| 8. |
WindowInfo |
| |
(Fri, Jan 06, 12:39pm) |
 |
|