Decimal Places in Attributes

Stephen D. King sdk at HARTLEYANDERSON.COM
Fri Feb 25 00:45:27 PST 2005


Ryan,
Thanks for your help. Unfortunately I'm still not having any success. Here's a bit of code from my attributes template:

...
<tr valign="top" class="style3">
<th width="110" align="right" bgcolor="#E7E7CF" scope="row"><span class="style3">Camera Easting </span></th>
<td bgcolor="#F8F8F1"><span class="style3">[Camera_Eas]</span></td>
</tr>
...

Where should I insert the javascript?

Thanks again,
Stephen

----- Original Message ----- 
From: "Ryan, Adam" <ARyan at co.linn.or.us>
To: "'Stephen King'" <sdk at HARTLEYANDERSON.COM>; <MAPSERVER-USERS at LISTS.UMN.EDU>
Sent: Thursday, February 24, 2005 4:22 PM
Subject: RE: [UMN_MAPSERVER-USERS] Decimal Places in Attributes


> 
> Stephen,
> 
> You could try grabbing them in a small javascript, round the values, and
> then placing them into the html element.  Something like this...
> 
> ...
> <script>document.getElementById("Northing").innerHTML = Math.round(
> [Northing] * 100 ) / 100;</script>
> <span id="Northing"></span>
> ...
> 
> Cheers,
> 
> Adam 
> 
> 
>> -----Original Message-----
>> From: Stephen King [mailto:sdk at HARTLEYANDERSON.COM] 
>> Sent: Thursday, February 24, 2005 4:13 AM
>> To: MAPSERVER-USERS at LISTS.UMN.EDU
>> Subject: [UMN_MAPSERVER-USERS] Decimal Places in Attributes
>> 
>> 
>> Hi,
>> Can anyone tell me how to control the number of decimal 
>> places that are displayed by MapServer in an attributes 
>> template file? For example, I have a Shapefile that has two 
>> attributes called Eastings and Northings. When I do a query 
>> on a point using MapServer, these are output as 
>> 574074.31920000003 6599349.41849999970, I would like to show 
>> these to only two decimal places. Thanks, Stephen
>> 
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050225/d5edd2e1/attachment.htm>


More information about the MapServer-users mailing list