[mapserver-users] How can I avoid long notation of double values in label or info template for shapes?

Astrid Emde astrid.emde at wheregroup.com
Fri Nov 23 02:04:08 PST 2012


Am 23.11.2012 10:39, schrieb Lars Lingner:
> On 23.11.2012 10:12, Astrid Emde wrote:
>> Hello,
>>
>> I have a shapefile with a column of type double that contains values
>> like 2.54 or -2.03.
>>
>> When I label the geometrie with this column or display this column in
>> my infotemplate I get the following notation of the values: 
>> 2.54000000000e+000 -2.03000000000e+000
>>
>> If there a way to tell MapServer to display the "normal" notation of
>> the value? Or do I have to change the shape?
>>
> You can define your own format by using
>
> ...
> CLASS
>   ...
>   TEXT (round[numbercolumn], 2)
>   ...
>   LABEL
>     ...
>   END
> END
> ...
>
> In RFC 64 [1] you'll find some informations.
>
> I'm pretty sure I used it for myself. But grepping through my current
> mapfiles say otherwise. So I can't give an working example.
>
>
> Lars
>
>
> [1] http://mapserver.org/development/rfc/ms-rfc-64.html
Hi Lars,

thanks for the information!

It works fine for the label.

Before I defined LABELITEM mycolumn and got  the long notation:
2.54000000000e+000

with definition TEXT mycolumn the label looks fine (without using any
function): 2.54

Is there a solution for the query result too?

Astrid





More information about the MapServer-users mailing list