Re: hexadecimal from byte?

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Thu, 17 Jan 2008 16:21:41 -0700

I f you want the hexadecimal representation of an integer value as a
string you could use the 'sprinti' routine:

ncl 1> print(sprinti("%x",100))
(0) 64
ncl 2> print(sprinti("%x",255))
(0) ff

or even

ncl 4> print(sprinti("0x%x",255))
(0) 0xff

  -dave

On Jan 17, 2008, at 4:01 PM, Andrea Hahmann wrote:

> Reading the documentation, I have found that I can convert an
> hexadecimal number to integer using the function "stringtointeger".
> Is there a function to do the conversion back? If not, perhaps
> somebody has already written such a thing?
>
> Thanks,
> Andrea
>
> --
> ----------------------------------------------------------------
> Andrea N. Hahmann, Ph.D.
> Research Applications Laboratory
> Natl. Center for Atmospheric Research Phone: 1-303-497-8383
> PO BOX 3000 Fax: 1-303-497-8401
> Boulder, CO 80301 hahmann_at_ucar.edu
> ----------------------------------------------------------------
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 17 2008 - 16:21:41 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 23 2008 - 14:19:33 MST