Take a look at the postgres round() function:  <a href="http://www.postgresql.org/docs/8.1/static/functions-math.html">http://www.postgresql.org/docs/8.1/static/functions-math.html</a><br><br>round(ST_Y(geom),6)<br><br>David.<br>
<code><br><br></code><br><div class="gmail_quote">On Tue, Apr 16, 2013 at 8:50 AM, Carsten Hogertz <span dir="ltr"><<a href="mailto:carsten.hogertz@gmail.com" target="_blank">carsten.hogertz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi everyone,<div>I've got the following SQL to extract the lat/lon of a polygone:</div><div><br></div>
<div>SELECT </div><div>ROW_NUMBER () over () as id, </div><div>name, </div>
<div>geom, </div><div>ST_Y(geom) as lat, </div><div>ST_X(geom) as lon </div><div>FROM (SELECT name, (ST_DumpPoints(geom)).* FROM timezones20032013) as foo</div><div><br></div><div>It gives me back the lat and lon as a number with a lot of digits, e.g.:</div>

<div>42.4734992980957</div><div>1.71096694469452</div><div><br></div><div>Instead what I need is:</div><div>42.473499</div><div>1.710967</div><div><br></div><div>How could I change my SQL to get the result cut/rounded?</div>

<div><br></div><div>Any help would be appreciated.</div><div><br></div><div>Thanks in advance</div><span class="HOEnZb"><font color="#888888"><div>Carsten</div>
</font></span></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
<br></blockquote></div><br>