function gt_percentd, item, header=header, string=string, spaces=spaces ; ; header_array = ['%Img', '???'] conv2str = ['Cls', 'Opn', '???'] ;3 characters conv2short = ['C', 'O', '?'] ;1 characters ; siz = size(item) typ = siz( siz(0)+1 ) if (typ eq 8) then begin tags = tag_names(item) if (tags(0) eq 'GEN') then out = item.sxt.percentd $ else out = item.percentd end else begin print, 'GT_PERCENTD: Input ust be a structure' out = 0 end ; out = fix(out/255.*100) ;scale to percentage ; fmt = '(i3, "%")' out = gt_conv2str(out, conv2str, conv2short, header_array, header=header, $ string=string, short=short, spaces=spaces, fmt=fmt) ; if (n_elements(out) eq 1) then out = out(0) ;turn it into a scalar return, out end