[Lazarus] DBGrid displays Float as integer

Santi svaa at ciberpiula.net
Wed Jan 31 17:17:26 CET 2024


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.


> Any idea how to correct that?
>
> It is a SQlite database.
>
> Info:
>
> Lazarus 3.99 (rev main_3_99-1333-g5c01e6a88e) FPC 3.2.2 x86_64-linux-gtk2
>
> Tipps are welcome ..,
>
>


-- 
Saludos
Santi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20240131/44fc4d82/attachment-0003.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/44fc4d82/attachment-0003.png>


More information about the lazarus mailing list