Ticket #2950 (closed enhancement: fixed)
Trim trailing zeros from fractional part of float field in dbf portion of shapefile
|Reported by:||bfraser||Owned by:||sdlime|
|Component:||MapServer C Library||Version:||5.2|
|Severity:||normal||Keywords:||trim trailing zeros dbf shapefile|
|Cc:||woodbri, khirst, dmorissette, jmckenna|
Numbers stored in a dbf field of type float have trailing zeros after the decimal point, and are retrieved (and rendered) by mapserver at full precision with all the trailing zeros. This can make labels, especially contour labels, very ugly.
Zeros trailing the decimal should be automatically trimmed. For example, 12.500000 should be rendered as 12.5 and 2000.0000000 should be rendered as 2000 with no trailing decimal.
A useful option would be to allow the setting the rendered precision in the mapfile, perhaps similar to the method in templates of [item precision=2].