Subject Re: Solution: Problem in TIB_Query and currency...
Author jocelyndionne@uraeus.qc.ca
Hello Claudio.


Thanks for the hint about INT64 values. I looked at your function
(CompToStr) and I understand the problem. I don't know what Jason
thinks about this, but my opinion is that we don't really need these
huge numbers when we deal with most currencies (depends on which
currency, I know...) . Numeric(x,y) will cover most of the ranges
that are necessary, I think (hope!).

I don't think it would be a good idea to use SQLScale in place of
CurrentDecimals... Because it would be possible that we could have a
field with 4 decimal positions and a currency with 2 decimal
positions... And we want to get a currency format.

Now that it works with Numeric(x,y) fields, I think it's easy to deal
with the limitations of this function for now. Maybe we could think
about a function that would do the good formatting for any numeric
values (and for any numeric type with decimals).

Bye.


Jocelyn Dionne.





--- In IBObjects@y..., "Claudio Valderrama C." <cvalde@u...> wrote:
> Very sensible approach, Jocelyn. Precision is all the number,
not the
> SqlScale as you discovered.
> Result := FloatToStrF( AsExtended,
> ffCurrency,
> 18 {-SQLScale},
> CurrencyDecimals )
>
> In this case, SqlScale sounds more appropriate in place of
> CurrencyDecimals, but it might be a disaster, not sure.
> Beware that this limit of 18 places may produce weird results
in the
> neighborhood of INT64's top values that go up to 9E18. Maybe Geoff
remembers
> the convoluted function I wrote to deal with this problem. See
> function CompToStr(n: comp): String;
> in IBA_Column.IMP if this gives you an idea.
>
> C.
>
> > -----Original Message-----
> > From: jocelyndionne@u... [mailto:jocelyndionne@u...]
> > Sent: MiƩrcoles 7 de Febrero de 2001 2:29
> >
> > Why does this return something strange instead of a currency? If
I
> > look in the help, it says that the third parm is the precision.
You
> > use SQLScale. I think it's the problem. The help says that for
an
> > extended variable, we can use 18 or less. So I changed the third
> > parameter to 18, given the fact that you use AsExtended in the
first
> > parameter. And it works...