julie_mcmanus
11 years agoOccasional Contributor
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 ...
- 11 years ago
((-10000)>>>0).toString(16)
A smarter person that me answered this question on Stack Overflow! http://stackoverflow.com/questions/57803/how-to-convert-decimal-to-hex-in-javascript
Look for the 'two's complement hexadecimal representation of a negative number' reply on the page above.