Opened 23 years ago

Closed 13 years ago

#60 closed enhancement (fixed)

Label formatting

Reported by: assefa Owned by: assefa
Priority: high Milestone: FUTURE
Component: MapServer C Library Version: 4.1
Severity: minor Keywords:
Cc: stephan.holl@…, jmckenna, dmorissette, sdlime

Description (last modified by dmorissette)

There was a request from a client to be able to format the output of his labels 
:
 For example the dbf file contains something like 1000.000 and he would like to 
display this value like an integer (1000).

 I should discuss this with Steve before going ahead. AY

Change History (9)

comment:1 by dmorissette, 21 years ago

Cc: steve.lime@… added
Version: 3.54.1
Maybe in 4.1?

comment:2 by assefa, 16 years ago

Milestone: FUTURE

comment:3 by sholl, 14 years ago

Cc: stephan.holl@… added

Since this ticket is quite old I am also interested in this feature and willing to test patches if available. In discussion with Steve he told me that this issue will be adressed in 6.0.

comment:4 by jmckenna, 14 years ago

Cc: jmckenna added

comment:5 by dmorissette, 14 years ago

Cc: dmorissette sdlime added
Description: modified (diff)

If we want this to happen we should talk about the way to specify the format string.

Adding Steve to CC to get his input. There is some basic format support in maptemplate.c for query result field values, but it seems quite limited. I wonder if we could use the same or if we would be better use a print-like format string.

comment:6 by jmckenna, 14 years ago

Some background: the dataset to be used in the FOSS4G2010 WMS benchmarking exercise has a label field with precision of 15. It would be really nice if we could tackle this ticket, as a showcase of the features added through the benchmarking exercise.

I can help through giving opinions, testing, and documenting.

comment:7 by sdlime, 14 years ago

I'm planning on tackling this through the extensions to the bison parser so that you could run text through formatting functions like so:

TEXT (commify(precision([area], 2)) + "sq mi")

or whatever.

Steve

comment:8 by dmorissette, 14 years ago

See also ticket #2950

comment:9 by dmorissette, 13 years ago

Resolution: fixed
Status: newclosed

Implemented in RFC 64 (MapServer 6.0), see also ticket #2950.

The syntax is something like:

      TEXT ("[area]")

      TEXT (tostring([area],"%.2f"))

      TEXT ("Area is: " + tostring([area],"%.2f"))
Note: See TracTickets for help on using tickets.