[Lazarus] DBGrid displays Float as integer
John Landmesser
jmlandmesser at gmx.de
Wed Jan 31 21:22:24 CET 2024
Am 31.01.24 um 17:17 schrieb Santi via lazarus:
> El 31/01/2024 a las 14:32, n Landmesser via lazarus escribió:
>>
>> An SQL satatement on a float field is displayed as an integer field
>> in a DBGrid. The fields are created "on the fly" they are not static!
>>
>>
>>
>> SQL statement is:
>>
>> "SELECT AVG( km_gelaufen ) FROM laufdaten"
>>
>> SQL returns the correct value "2,00739263803681" if i copy the value
>> in DBGrid, but DBGrid itself shows only integer value.
>>
>
> Look the format of the field component.
> Is it a TIntegerField? Maybe you selected the wrong field type, it
> should be a TFloatField
> If it is a TFloatField, look at display format. Maybe you haven't
> selected the number of decimal properly.
There is just the Database and a TQuery and the DBGrid , i execute the
SQL code and lazarus DBGrid shows the result as described above.
No static fielddefs with format options. The result field creates
lazarus "on the fly"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240131/05342b56/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uy07kNDNSh0Li7Lv.png
Type: image/png
Size: 36530 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240131/05342b56/attachment-0001.png>
More information about the lazarus
mailing list