06-04-2015 05:48 AM
Hi All,
I did typecasting to convert hex string to decimal which is only working fine for only 16 bytes (if i typecast to 64 uint 32 datatype).
If i want to convert more than "911083110000831104009119" how to do that.
right now it is working only for "9110831100008311".
How to convert full hex string to decimal value.
Kinldy suggest me.
Regards
Punith
06-04-2015 06:10 AM
What format do you want in the end? A 64-bit numeric is the largest integer I have seen. Do you want an array of numerics?
06-04-2015 06:18 AM
not sure if thats what you mean
replace the wire from "uI64" with one from "uI32"
right-clicking on the numeric-constant and "Representation" lets you change the datatype
06-04-2015 06:25 AM
jwscs wrote:
replace the wire from "uI64" with one from "uI32"
right-clicking on the numeric-constant and "Representation" lets you change the datatype
Slight problem with that: The hex string is 24 characters, which equates to 96 bits.
Maybe we should take a step back. Punee, what exactly are you trying to do with the data. I seriiously doubt you are trying to deal with 96-bit numbers.
06-04-2015 06:49 AM
I am taking output from my hardware which in hex string format , now i need to some calculation by converting to decimal then resulted value should set numeric indicator.
So my hardware giving random hex string ,it may be 1,2,4 byte , 8 byte, 16, or 24 byte. This i need to convert to decimal.
How
06-04-2015 06:53 AM
The fallowing example is not working for 1byte and 2 byte and 3 byte. Could you please tell me , how to solve this.
Regards
Punith
06-04-2015 07:05 AM - edited 06-04-2015 07:06 AM
i think the problem lies with Least- and MostSignificantBit.
it might be that you have to fill your "hex-string" with leading zeros too
06-04-2015 07:36 AM
Ah. You are being sent raw data, not ASCII formatted characters.
Again, the 24 (and 16) byte will be an issue since a U64 is only 8 bytes. So we are left with the question of how you want to either display this or process in some way.
06-04-2015 07:36 AM