<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">If you're really concerned about output
format, rather than the actual value, consider the <b>to_char</b>()
function:<br>
<br>
<tt>select to_char (42.4734992980957, '999D999999')</tt><tt><br>
</tt><tt>--> " 42.473499"</tt><br>
<br>
where you also get right justification for free.<br>
<pre class="moz-signature" cols="72">Martin Feuchtwanger <a class="moz-txt-link-abbreviated" href="mailto:feumar@shaw.ca">feumar@shaw.ca</a> 604-254-0361
Vancouver, BC V5N 1J6
<a class="moz-txt-link-freetext" href="http://members.shaw.ca/geomatics.developer">http://members.shaw.ca/geomatics.developer</a>
On 16/04/2013 7:22 AM, Carsten Hogertz wrote:
</pre>
</div>
<blockquote
cite="mid:CANV8A=CGJZkiWn_Snh6xuF2JoTzH224Bd+gEgGU-BnO7yhH8Aw@mail.gmail.com"
type="cite">
<div dir="ltr">Perfect! Thank you guys.
<div style="">Carsten</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">2013/4/16 Hugues François <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:hugues.francois@irstea.fr" target="_blank">hugues.francois@irstea.fr</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr" align="left"><span
style="FONT-FAMILY:Arial;FONT-SIZE:10pt"><span>And
what about round(st_y(geom)::numeric, 6) ?</span></span></div>
<div dir="ltr" align="left"><span
style="FONT-FAMILY:Arial;FONT-SIZE:10pt"><span></span></span><br>
</div>
<span style="FONT-FAMILY:Arial;FONT-SIZE:10pt"><span></span></span>
<div dir="ltr" align="left" lang="fr">
<hr>
<font face="Tahoma">
<div class="im"><b>From:</b> <a
moz-do-not-send="true"
href="mailto:postgis-users-bounces@lists.osgeo.org"
target="_blank">postgis-users-bounces@lists.osgeo.org</a>
[mailto:<a moz-do-not-send="true"
href="mailto:postgis-users-bounces@lists.osgeo.org"
target="_blank">postgis-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Carsten Hogertz<br>
</div>
<b>Sent:</b> Tuesday, April 16, 2013 4:05 PM<br>
<b>To:</b> PostGIS Users Discussion<br>
<b>Subject:</b> Re: [postgis-users] Cut lat/lon to six
decimal digits</font><br>
</div>
<div>
<div class="h5">
<div dir="ltr">Thanks.
<div>Indead I did. I also tried </div>
<div>trunc(ST_Y(geom), 6)</div>
<div>But it gives back:</div>
<div>Function round(double precision, integer) does
not exist<br>
</div>
</div>
<br>
<div class="gmail_extra">
<div class="gmail_quote">2013/4/16 Hugues François <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:hugues.francois@irstea.fr"
target="_blank">hugues.francois@irstea.fr</a>></span><br>
<blockquote style="BORDER-LEFT:#ccc 1px
solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex"
class="gmail_quote">
<div>
<div dir="ltr" align="left"><font
color="#0000ff" face="Arial"><span></span></font><font
color="#0000ff" face="Arial"><span>Did you
simply try</span></font></div>
<div dir="ltr" align="left"><font
color="#0000ff" face="Arial"><span>round(ST_Y(geom),
6) as lat</span></font></div>
<div dir="ltr" align="left"><font
color="#0000ff" face="Arial"><span><span>round(ST_X(geom),
6) as lon</span></span></font> <br>
</div>
<div dir="ltr" align="left" lang="fr">
<hr> <font face="Tahoma"><b>From:</b> <a
moz-do-not-send="true"
href="mailto:postgis-users-bounces@lists.osgeo.org"
target="_blank">postgis-users-bounces@lists.osgeo.org</a>
[mailto:<a moz-do-not-send="true"
href="mailto:postgis-users-bounces@lists.osgeo.org"
target="_blank">postgis-users-bounces@lists.osgeo.org</a>]
<b>On Behalf Of </b>Carsten Hogertz<br>
<b>Sent:</b> Tuesday, April 16, 2013 3:51
PM<br>
<b>To:</b> PostGIS Users Discussion<br>
<b>Subject:</b> [postgis-users] Cut
lat/lon to six decimal digits<br>
</font><br>
</div>
<div>
<div>
<div dir="ltr">Hi everyone,
<div>I've got the following SQL to
extract the lat/lon of a polygone:</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>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>Instead what I need is:</div>
<div>42.473499</div>
<div>1.710967</div>
<div>How could I change my SQL to get
the result cut/rounded?</div>
<div>Any help would be appreciated.</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</blockquote>
<br>
</body>
</html>