Hello,
I have a hexadecimal value which I converted to decimal with the following formula:
StringVar HexValue:= {SP_CALL_RECORD.CONN_ID};
NumberVar DecValue:=0;
NumberVar Factor:=1;
NumberVar j:=0;
NumberVar x;
for j := len(HexValue) to 1 step -1
do
(
if asc(uppercase(HexValue[j])) in 65 to 70 then
tmpVal := asc(uppercase(HexValue[j])) - 55
else
tmpVal := val (HexValue[j]);
if (j=16) then
x := tmpVal*Factor;
DecValue := DecValue + (Factor * tmpVal);
Factor := Factor * 16
);
DecValue
The problem is, the result is a very large number (17 digits), and it is being rounded to the hundreds place. I have tried converting the value with the ToText function, but the rounding still occurred. Any ideas?
Thanks!
I have a hexadecimal value which I converted to decimal with the following formula:
StringVar HexValue:= {SP_CALL_RECORD.CONN_ID};
NumberVar DecValue:=0;
NumberVar Factor:=1;
NumberVar j:=0;
NumberVar x;
for j := len(HexValue) to 1 step -1
do
(
if asc(uppercase(HexValue[j])) in 65 to 70 then
tmpVal := asc(uppercase(HexValue[j])) - 55
else
tmpVal := val (HexValue[j]);
if (j=16) then
x := tmpVal*Factor;
DecValue := DecValue + (Factor * tmpVal);
Factor := Factor * 16
);
DecValue
The problem is, the result is a very large number (17 digits), and it is being rounded to the hundreds place. I have tried converting the value with the ToText function, but the rounding still occurred. Any ideas?
Thanks!