Subject Re: [IBO] Is CURRENCY field column attributes ignored?
Author Geoff Worboys
Hi Marco,

> I've a mynum NUMERIC(15,2), defined as CURRENCY in the
> query. Having a look at IBA_Column.IMP i can see that
> when I edit that field in a IB_Edit and exiting the
> value is assigned to the field, it's called the code
> for a generi floating field
>
> TIB_ColumnNumeric.SetAsString(
> ...
> try
> Value := StrToFloat( tmpVal );
> except
> ...
>
> so a value like 21321545000010,00 is accepted (!!! it's 16
digits+00).

AFAIK this is actually consistent with IB/FB - in that field precision
is not honoured - presumably because they have only just gotten around
to actually storing the information, and since it is not available to
the client (without lots of extra work) there is no way for IBO to
validate this properly.


> But if you try to set this value to the field with
> Field.AsCurrency := 21321545000010
> an error occurs (welcome!)

What error and when does it occur? Do you have a callstack for the
error?

Please ensure that you tell us the server type and version and the
delphi/bcb version that you are using. All these factors are required
to know what to expect in a given situation with numeric/decimal
types - since the processing and storage types vary accordingly.


> I don't understand this situation... and what's the use
> of CURRENCY column attribute?

It is only used to manage the default displaytext. If you have your
own displayformat or editmask then the attribute is ignored. It does
not have any impact on the value processing.


Geoff Worboys
Telesis Computing