Subject Re: [IBO] Re: DisplayFormat issue - EConvertError
Author Helen Borrie
>
>> Besides saying which fields are causing this problem, also indicate what data type it is (or they are) in the database and how you are casting it (them) in the dataset - including the CalculatedFields! Also, can't see any sign in the DFM that you have set any of these fields as Currency.

At 04:59 AM 25/11/2010, Joe wrote:

>The database is Firebird 2.1.2. The data type of the numerical fields in the database is Double Precision.
>
>I'm not sure what you mean by "how you are casting it (them) in the dataset".

For example, what "As..." method[s] are you using to refer to parameters? For a Double used as currency you would need AsCurrency, which IBO would convert internally to a 2-place decimal. If you're just using its Value property, any decimal part will have many more places of decimal than just the two in your display mask.

Or what casting you might be doing somewhere in your code to convert Double to 2 places of decimal to fit your mask?

>I don't think I'm explicitly casting anything. Would that be shown in the DFM I posted, or should I be looking somewhere else?

If you set the Currency attribute on the field in ColumnAttributes then it should show in the DFM and IBO would perform the conversion itself as required.

>The two calculated fields in the dataset are defined as Double Precision as well, as shown in the DFM I posted.

Sorry, missed that. Same problem with those.

Helen