Here is a simple Packed to Decimal routine I have called (I call it P2D)
that will work with standard definitions:
/* REXX */
hex = C2X(Arg(1));
result = Left(hex,Length(hex)-1);
If Right(hex,1) = 'D' Then Return '-'result; Else Return result;
and then to go back from decimal to packed (yep, called D2P), using only C
and D nibbles:
/* Rexx decimal to packed */
arg dec
If dec < 0 then s = 'D'; else s = 'C'
n = space(translate(dec,,'+-.')s,0)
Return X2C(right(n,length(n)+length(n)//2,'0'))
Billy
--
Thank you and best regards,
*Billy Ashton*