Wouldn't be easier to make a call to sprintf from the C library? That
should work fine for any case :-)
F_
On 16 Jun 2003, Steve Wampler wrote:
>
> Hmmm, I think the fixnum() routine has other problems in printf.icn
> as well. Here's another improved version, that correctly
> handles printf("%10.7r",-0.2e-5), for example:
> ------------------------------------------------
> procedure fixnum(x, prec)
> local int, frac, f1, f2, p10
>
> /prec := 6
> int := integer(x) | return image(x)
> frac := image(abs(x - int))
> if find("e", frac) then {
> frac ?:= {
> f1 := ((tab(upto('.')) & move(1))|"") &
> f2 := tab(upto('e')) &
> move(1) &
> p10 := -integer(tab(0)) &
> repl("0",p10-1) || f1 || f2
> }
> }
> else
> frac ?:= (tab(upto('.')) & move(1) & tab(0))
> frac := left(frac, prec, "0")
> if (int = 0) & (x < 0) then int := "-"||int
> return int || "." || frac
> end
> --------------------------------------------
> Someone should probably take a close look to see if this
> introduces other problems, though!
>
> --
> Steve Wampler -- [EMAIL PROTECTED]
> Quantum materiae materietur marmota monax si marmota
> monax materiam possit materiari?
>
>
> -------------------------------------------------------
> This SF.NET email is sponsored by: eBay
> Great deals on office technology -- on eBay now! Click here:
> http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
> _______________________________________________
> Unicon-group mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/unicon-group
>
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group