On 24-Jan-00, [EMAIL PROTECTED] wrote:
> That works, but it's not exactly what I wanted. I want to round a
> decimal and print it, not convert it to string, shorten it and then
> print it.
Obviously I haven't gotten fully onto the REBOL wain, Michal. ;^)
> > The following gives an error, but it shouldn't IMHO. What's the point of
> > having "pi" if it won't substitue for the decimal number?
> >
> > new-string: COPY/PART pi 4
> > PRINT new-string
> pi is decimal, not string:
Yup! Still, the "idea" should have worked. Strings and numbers have length.
Asking for a count-length should have worked, regardless of type.
> It worked just by coincidence, it won't round 3.228 correctly.
> >> copy/part to-string 3.228 4
> == "3.22"
Of course, it couldn't, but this did:
>> copy/part to-string (3.228 + .005) 4
== "3.23"
There was an earlier discussion about rounding in general, but I can't
remember if any code came of it. I didn't see anything in the math manuals.
--
---===///||| Donald Dalley |||\\\===---
The World of AmiBroker Support
http://webhome.idirect.com/~ddalley
Member: ICOA and Team AMIGA