Forum Discussion

julie_mcmanus's avatar
julie_mcmanus
Occasional Contributor
11 years ago

Converting data types

I'm trying to convert an integer to a hex string in Jscript.

Say my value is newdata =  -100000,



using the code:  var hexString = newdata.toString(16);



it returns the value

-186A0

which is 100000 with the - appended at the front.  What I want is FFFE7960



Now in the watch list, when I edit the value for 'newdata' to be Hex, the watch list does display 0xFFFE7960 which is what I'm after but I can't figure how to do this conversion in code.