Converting Negative Numbers to Hex
359473Feb 17 2004 — edited May 21 2006Hello,
I have a number filed which holds the representation of RGB colors in decimal number.
I would like to get the Hex string representation and split the Alpha, Red, Green, Blue values in my query to pass to my application.
I have used the to_char (number, xxxxxxxx) and to_char (number, fm0xxxxxxxx) and with negative numbers both returns # signs!
Here is an example:
The value in the color filed is -16776961. Converting this number to Hex using 4 bytes representation gives me FF0000FF. Bytes from left to right represent Alpha, Red, Green, and Blue values. In this case the RGB value represents color Blue (FF) and the Alpha value is FF also.
Is there anyway I can get the hex representation of negative numbers.
Thanks in advance.
AR