[Geoserver-users] Can I suppress .0 for a double in TextSymbolizer?

I'm not sure I'm describing this problem well, but here goes:

I have some values that label with a .0 added to the number.
For example, elevation values - 2483.0 feet.
I really do not want to print the .0 - is there a way to suppress it?
(using a truncate function
Only certain fields have this problem - it seems to be whole numbers stored
as Double
(this is ESRI ArcCatalog's Properties talking).

For example, see CONTOUR_FT for massgis:GISDATA.CONTOURS250K_ARC:

click on a line to see the feet display with .0 added.

http://giswebservices.massgis.state.ma.us/geoserver/wms?bbox=64099,933332,64301,933537&styles=&Format=application/openlayers&request=GetMap&layers=massgis:GISDATA.CONTOURS250K_ARC&width=800&height=458&srs=EPSG:26986

--
View this message in context: http://www.nabble.com/Can-I-suppress-.0-for-a-double-in-TextSymbolizer--tp14925886p14925886.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

aleda_freeman ha scritto:

I'm not sure I'm describing this problem well, but here goes:

I have some values that label with a .0 added to the number.
For example, elevation values - 2483.0 feet.
I really do not want to print the .0 - is there a way to suppress it?
(using a truncate function Only certain fields have this problem - it seems to be whole numbers stored
as Double
(this is ESRI ArcCatalog's Properties talking).

For example, see CONTOUR_FT for massgis:GISDATA.CONTOURS250K_ARC:

click on a line to see the feet display with .0 added.

http://giswebservices.massgis.state.ma.us/geoserver/wms?bbox=64099,933332,64301,933537&styles=&Format=application/openlayers&request=GetMap&layers=massgis:GISDATA.CONTOURS250K_ARC&width=800&height=458&srs=EPSG:26986

I'm a little at a loss here. Do you want to suppress the .0
in a text symbolizer used in the map, or in the output of
of GetFeatureInfo?

If we could map types and say, no, that's really an integer,
you would be gold, but we can't.
So, for GetFeatureInfo you can try to develop a freemarker
template that shaves off the .0 from that attribute.
For the text symbolizer there is no user level way, you need
to develop a FilterFunction that allows you to reformat numbers,
basically exposing what java NumberFormat classes can do (we
dont' have that at the moment but it's definitely doable and
relatively easy for a java programmer). Saul? :wink:
Cheers
Andrea