Hi
I have hex that is bea000000004080bh, I tried hextonumber("bea000000004080bh"), but it is not working. Can someone help me?
Hi,
Are you sure it is a 64-bit Hexadecimal? Including the "h" digit does not seem to conform with the standard format.
Best,
TS
sorry, forgot to remove the h at the end. the output raw always have h at the end to indicate hex value which we need to exclude before we do hextonumber.
Now the issue is it doesnt match to the number as what we expected.JMP converted it as -4.768372e-7expected is -4710765210229274613
What I m missing?
The value you show is signed integer and HexToNumber() returns unsigned integer.
Also you need to specify the base, something like
a = HexToNumber("bea000000004080b",Base(16));
To get around the signed integer issue, you can use a formula like this:
max = HexToNumber("7fffffffffffffff",Base(16)); a = HexToNumber("bea000000004080b",Base(16)); if( a > max, result = -(max+1) + (a-max); , // else result = a; );
But then you run into another issue which is JMP cannot render a 64-bit integer value precisely. The last two digits will get truncated and have random values. I would recommend breaking up your 64-bit value into a upper 32-bit value, and a lower 32-bit value, and store those values in two separate columns. Something like this:
Upper32 = HexToNumber( Left( :hex64, 8 ), Base( 16 ));<BR />Lower32 = HexToNumber( Right( :hex64, 8 ), Base( 16 ));
Refer to the attached data table example.
sounds like there is improvement needed for the hextonumber() why cant it do the same like the calculator do (see picture in very first post)?
breaking down upper and lower 32 is not efficient when dealing with millions of data points. I have to process hundred of files that each contains more than 40M rows of hex value. doing the breaking down 32 will consume too much time.any other suggestion?