Subject Re: [IBO] How to display in TIB_GRID ?
Author Lucas Franzen
Zoran,


Zoran Zivkovic schrieb:

>
> I have a folowing Query:
>
> SELECT DISTINCT PARTNO
> , EAPARTNO
> , FILTER_TYPE
> , COMMENT
> , ((CENOVNIK.SP*83*1.18)/1) AS MPC
> FROM FILTER_PARTS
> LEFT OUTER JOIN CENOVNIK ON (FILTER_PARTS.EAPARTNO=CENOVNIK.EAPARTNO)
>
> Question: How to display value of column MPC in TIB_GRID with only 2
> decimal places ? I get as result value 593.5164, and I dont know how to
> format display (or any other solution ?) as 593.52.

In addition to what Helen already told you you can also use the display
format property of the TIB_Query.

Open it, prepare the statement, change to the FieldProperties page,
select the field MPC and enter the appropriate display format, i.e.
#,###0.00 if you want to show it with a comma as thousand separator, a
dot as the decimal separator and a precision of two digits.

In general: Just enter the "delphi"-format string for your field and it
will be formatted accordingly on display.

(If you have more than one field with that format, you can mark all the
fields (multiselect) and enter the format string then; it will be
assigned to all the selected fields then)


This is valid for all formatting.
For example, if you want to format a datetime field you can enter:

dd.mm.yyyy [hh:nn:ss]

and it will will show as

"25.04.2005 [11:22:06]").

Luc.