Subject | Re: [ib-support] Re: IB dumber than a $5 calculator |
---|---|
Author | Paul Schmidt |
Post date | 2002-05-30T17:17:11Z |
On 30 May 2002 at 13:59, rrokytskyy wrote:
off the top of my head.
Paul Schmidt, President
Tricat Technologies
paul@...
www.tricattechnologies.com
> > The problem is this:Okay, so I missed a couple of brackets, I should have warned it was untested and
> >
> > Take the diameter of an old metal swimming pool I had in the 1970's
> 18 feet, now I
> > want the circumference in metres.
> >
> > 'Calc = ' || '18' * .3048 * '3.14' the output variable is a VARCHAR
> (20)
> >
> > what it really needs to do is convert the 18 to a double and the
> 3.14 to a double, do
> > the math and cast the result to a string, concatenate that to any
> strings and sanity
> > check the result for length. In this case the result would be Calc
> = 17.227296 at
> > least according to my Canon F-502 calculator.
>
> Do not want to comment your statement about IB, but the right
> statement would be:
>
> 'Calc = ' || ('18' * .3048 * '3.14')
>
> at leaset this works:
>
> select 'Calc = ' || ('18' * .3048 * '3.14') from rdb$database
>
> Usually statements are evaluated from left to right, and there is not
> precedence between * and || operators.
>
off the top of my head.
Paul Schmidt, President
Tricat Technologies
paul@...
www.tricattechnologies.com