Steve,<br><br>Thanks for the update this was really helpful.<br><br>Best regards,<br><br>Tamas<br><br><br><br><div class="gmail_quote">2010/12/10 Lime, Steve D (DNR) <span dir="ltr">&lt;<a href="mailto:Steve.Lime@state.mn.us">Steve.Lime@state.mn.us</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div link="blue" vlink="purple" lang="EN-US"><div><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">The work for RFC 64 has support for this already. I’ll have to go back to my notes for more detail but I think this is correct:</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> Case 1: using LABELITEM… In this instance you get the full representation of the of the number according to the DBF definitions. If you access a numeric column in string context in an logical expression you’ll also get this (e.g. ‘[numcol]’).</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> Case 2: using TEXT expression with no transformation and numeric context (e.g. TEXT ([numcol])). This forces the number through the new expression handling. In this case we have to do a conversion from a number to a string and the default format I chose was “%g” which results in some relatively reasonable trimming.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">  Case 3: using TEXT expression with transformations. I added several functions to the parser to help in this regard:</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">   Round(num, num) (e.g. round([numcol], 2))</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">   Tostring(num, format) (e.g. tostring([numcol], “%.2f”), note this truncates so you might want to round and then convert to string)</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">   Commify(string) (e.g. commify(‘[numcol]’), typically you’d do this after converting to a string so 20000.00 would become 20,000.00)</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">It’s pretty flexible although there’s almost certainly room for improvement.</span></p>
<p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);">Steve</span></p><p class="MsoNormal"><span style="font-size: 11pt; color: rgb(31, 73, 125);"> </span></p>
<div style="border-width: 1pt medium medium; border-style: solid none none; border-color: rgb(181, 196, 223) -moz-use-text-color -moz-use-text-color; padding: 3pt 0in 0in;"><p class="MsoNormal"><b><span style="font-size: 10pt;">From:</span></b><span style="font-size: 10pt;"> <a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a> [mailto:<a href="mailto:mapserver-dev-bounces@lists.osgeo.org" target="_blank">mapserver-dev-bounces@lists.osgeo.org</a>] <b>On Behalf Of </b>Tamas Szekeres<br>
<b>Sent:</b> Friday, December 10, 2010 12:07 PM<br><b>To:</b> <a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br><b>Subject:</b> [mapserver-dev] Mapserver numeric formatting of labels</span></p>
</div><div><div></div><div class="h5"><p class="MsoNormal"> </p><p class="MsoNormal">Hi All,<br><br>Do we have any plans to support numeric formatting when rendering labels from layer attributes? As far as I remember we had such plans for 6.0, but I&#39;m not sure whether anyone is working on that actually or not.<br>
Any idea for a reasonable approach would also be helpful.<br><br><br>Best regards,<br><br>Tamas<br><br><br><br><br> </p></div></div></div></div></blockquote></div><br><div style="visibility: hidden; left: -5000px; position: absolute; z-index: 9999; padding: 0px; margin-left: 0px; margin-top: 0px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 130%;" id="avg_ls_inline_popup">
</div>