Subject | Re: [IBO] TIBOTable Suggestion |
---|---|
Author | Hans Hoogstraat |
Post date | 2004-10-23T20:02:10Z |
Hello Jason,
Currently, Decimal(18,2) values in a Grid connected to a TIBOQuery show up
with the decimal place displayed anywhere in the displayed grid field, not
lined up
pretty with only two decimal placed as expected. Of courseyou can correct
that by
populating the TIBOQuery with the fields and adjusting the individual field
display
attributes. However, if the same TIBOQuery is used for various dynamically
altered
queries, you don't have this option available.
Actually with the extra 0, this looks even better:
if tmpCol.SQLscale >= 0 then
(tmpField as TNumericField).DisplayFormat := '#0'
else
(tmpField as TNumericField).DisplayFormat := '#0.'
+Copy('000000000000000000',1,-tmpCol.SQLscale);
Probably all a matter of taste
Best Regards
Hans
Currently, Decimal(18,2) values in a Grid connected to a TIBOQuery show up
with the decimal place displayed anywhere in the displayed grid field, not
lined up
pretty with only two decimal placed as expected. Of courseyou can correct
that by
populating the TIBOQuery with the fields and adjusting the individual field
display
attributes. However, if the same TIBOQuery is used for various dynamically
altered
queries, you don't have this option available.
Actually with the extra 0, this looks even better:
if tmpCol.SQLscale >= 0 then
(tmpField as TNumericField).DisplayFormat := '#0'
else
(tmpField as TNumericField).DisplayFormat := '#0.'
+Copy('000000000000000000',1,-tmpCol.SQLscale);
Probably all a matter of taste
Best Regards
Hans
----- Original Message -----
From: "Jason Wharton" <jwharton@...>
To: <IBObjects@yahoogroups.com>
Sent: Saturday, October 23, 2004 1:44 PM
Subject: RE: [IBO] TIBOTable Suggestion
|
| Will you please tell me more why this is a benefit?
|
| I don't really understand why it should also override in the case that
| someone placed a value in there that they want, which is what your code
| would do.
|
| Jason
|
| > -----Original Message-----
| > From: Hans [mailto:hhoogstraat@...]
| > Sent: Friday, October 15, 2004 7:06 PM
| > To: IBObjects@yahoogroups.com
| > Subject: [IBO] TIBOTable Suggestion
| >
| >
| >
| > Hello Jason,
| >
| > I like to suggest the following code change to TIBODataSet.pas
| >
| > Around line 2915:
| >
| > // (tmpField as TNumericField).DisplayFormat := tmpCol.DisplayFormat;
| >
| > change to
| >
| > if tmpCol.SQLscale >= 0 then
| > (tmpField as TNumericField).DisplayFormat := '#'
| > else
| > (tmpField as TNumericField).DisplayFormat := '#.'
| > +Copy('000000000000000000',1,-tmpCol.SQLscale);
| >
| > This change displays Numeric(x,y) fields using a
| > DisplayFormat of (#.y(0's))
| > on
| > non field populated TIBOTABLES OR TIBOQUERIES (dynamic built SQL)
| >
| > Thank You
| > Hans
|
|
|
|
|
___________________________________________________________________________
| IB Objects - direct, complete, custom connectivity to Firebird or
InterBase
| without the need for BDE, ODBC or any other layer.
|
___________________________________________________________________________
| http://www.ibobjects.com - your IBO community resource for Tech Info
papers,
| keyword-searchable FAQ, community code contributions and more !
| Yahoo! Groups Links
|
|
|
|
|
|
|