Home MathPack Math1 Conversion Hex 

See also: Bin, Octal, Decimal, GrayCode, ScanHex, Roman, FPNumToHex 

Hex 

Unit:  SDL_math1  Class:  None  Declaration:  function Hex (innum: longint; places: byte): string; 
The function Hex converts the integer number innum to an ASCII string which is the hexadecimal representation of that number. The number is written with a variable number of places, which can be defined by the parameter places (1..8). Leading zeros are not suppressed.
Hint: 
If the value of the parameter places is less than one or greater than eight the value is automatically restricted to these boundaries (whichever is next). If places does not suffice to display the hexadecimal representation, then the resulting string is truncated. 
Example: 
write (Hex (2334,4)); writes the number 2334 using hexadecimal notation with 4 characters ('091E');

