MySQL decimal field rounded to nearest integer

Stephane Lessard LESSARDST at DFO-MPO.GC.CA
Tue Feb 22 12:57:32 PST 2005


Hello List!

The fields that are supposed to be MySQL "decimal" are rounded, and
displayed as integer by ogrinfo and MapServer. For example, in my query
template I have the following:

...
Depth: [Depth] m <br>
...

The value in my MySQL DB is a decimal (8,3), for example "10.4". In my query
result page, I get "Depth: 10 m". The same happens with every decimal field.
The field is rounded, not truncated.

I use an ODBC connection, and it works fine when I test this connection with
another tool. The values are ok. My data used to be in an Access DB, and it
worked fine then. So I suspect that OGR does not support MySQL properly for
decimal fields.

Does anyone have a suggestion, workaround or comment?

Thank you!

Stéphane Lessard, ing. jr.
Ingénieur Systèmes Ordinés
Systèmes Électroniques et Informatiques
Garde Côtière Canadienne
Région du Québec
101, boul. Champlain, Québec, QC G1K 7Y7
Tél.: (418) 649-6351
Télécopieur : (418) 649-6876
Courriel : lessardst at dfo-mpo.gc.ca <mailto:lessardst at dfo-mpo.gc.ca> 



More information about the MapServer-users mailing list