Viewing contents of file '../idllib/contrib/mallozzi/hex.pro'
; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
;+
; NAME:
; HEX
;
; PURPOSE:
; Given an input number, returns a hexadecimal string
;
; CALLING SEQUENCE:
; result = HEX(value)
;
; INPUTS:
; value: LONG number. If any other type is supplied, it is converted to LONG
;
; KEYWORDS:
; NONE
;
; OUTPUTS:
; result: string representing the input number in hexidecimal
;
; COMMON BLOCKS:
; NONE
;
; SIDE EFFECTS:
; NONE
;
; RESTRICTIONS:
; No error checking for overflow
;
; DEPENDENCIES:
; NONE
;
; EXAMPLE:
; IDL> PRINT, HEX(500)
; 1F4
;
; MODIFICATION HISTORY:
; v1.0: Written, 1997 September, Robert.Mallozzi@msfc.nasa.gov
;-
FUNCTION HEX, value
RETURN, STRTRIM(STRING(FORMAT = '(Z)', LONG(value)), 2)
END