Hi Mark,

You can use an OGR connection for formatting of number fields when labelling in 
MapServer version 5.x. I think you need GDAL 1.6 or later.

For example with a shapefile called test.shp with a field, testfld1, you can do 
the following to show only two decimal places.

LAYER
   ..
   CONNECTIONTYPE OGR
   CONNECTION "test.shp"
   DATA "select CAST(testfld1 AS numeric (4,2)) from test"
   ..
   CLASS
       ...
       TEXT ([testfld1)]
       LABEL
        ..
       END
   END
END

Regards,

Kathleen

________________________________
From: [email protected] 
[mailto:[email protected]] On Behalf Of Mark Volz
Sent: Thursday, 28 July 2011 5:26 AM
To: [email protected]
Subject: [mapserver-users] display labels as an integer instead of scientific 
notations.

Hello,

I have a label that displays a number in scientific notation;  for example 
2.08+e002.  I would like the label to display as an integer such as 2.08.  In 
the past I asked a similar question about HTML templates and someone mentioned 
that I should use "[item name="area" precision=2]"  Unfortunately, the 
statement seems invalid as a label in the .map file.

Does anyone know how I can display a number as an integer?  Or will I have to 
convert all my values to Text?  I am using mapserver 5.4

Thanks

Mark



_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to