You could just use the replace function.
function newnum pnum
put offset(".",pnum,3) into trem
if trem = 0 then --only a single decimal
return pnum
else
--we have more than on decimal, remove good number for later
put char 1 to trem+2 of pnum into newnum
delete char 1 to trem+2 of pnum
--fix remaining numbers
replace "." with " 0." in pnum
--return the lot
return newnum&pnum
end if
end newnum
This assumes the numbers to unpack are less than 100 (i.e. 99.99 is the
largest).
If not, you would need to adjust the initial conditional to work out if there
was a compaction.
James
_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode