I have the result of the query, which is displayed in the DbGrid , can be an integer, or it can be a floating point number. How to make the field displayed in DbGrid output in the format '00.00' ? That is, in a monetary format.

    2 answers 2

    You need to open the table field editor by double-clicking the TTable (TADOTable), TQuery (TADOQuery) components, add all fields with the Add all fields ... command of the context menu and find the required money field in the list. Money fields TField has a Boolean property Currency, it needs to be set to True.

    • I don’t have the currency type field there, but the result of the SUM aggregate function ... and the SUM field does not have the logical property. Currency - Leonid
    • And what database itself? Silly, of course, but it may depend on it. If, for example, it is Access, then you can make a request in it, and table trim to TADOTable. - DelphiM0ZG

    Here it is necessary not to apply to the DBGrid, but to the process of creating the database. If during the creation of the table you specified the type of the IT field as currency, then everything should work =)

    • there is such a thing ... the field itself is of the currency type, but ... the SUM (Field) is output ... that is, the result of the aggregate function ... the result is not displayed in the currency format - Leonid