epiz Posted June 27, 2023 Report Share Posted June 27, 2023 I have taken the form date/time string function and want to extract different components(day, month, year, minutes, hours). In doing so I want to convert each number to its hexadecimal form. In my case I have converted the number to a decimal(to eliminate/track any error in the conversion) and then used the type cast function to convert to hexadecimal. I want to know why when I have an input of 6 and then I get a hex value of 0000 0000 0000 0006. I simply just want the 06 value. What can I do to fix this? I want to eliminate having to extract the 06 into another substring. Quote Link to comment
Bryan Posted June 28, 2023 Report Share Posted June 28, 2023 (edited) It appears that the decimal "6" is being provided as a 32 bit integer based on your description. You'll need to convert it to an 8 bit integer before type casting. Without seeing your code, I made an assumption and created the example below, which returns the hex value "6" for the month of June: Edited June 28, 2023 by Bryan Quote Link to comment
epiz Posted June 28, 2023 Author Report Share Posted June 28, 2023 Thank you. This is perfect. I had done without the 8 bit conversion and did another string subset. This helps simplify what I had done Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.