[postgis-users] set nr of decimales without changing field type

Gery . gamejihou at hotmail.com
Fri Oct 7 12:29:41 PDT 2011



Thanks Puneet for the link, it worked like a charm.

@Sandro: also, I forgot to thank you, the link is very useful, although it'd be great if more examples could be added there.

Thanks guys, PostGis rocks.


----------------------------------------
> From: gamejihou at hotmail.com
> To: postgis-users at postgis.refractions.net
> Subject: set nr of decimales without changing field type
> Date: Fri, 7 Oct 2011 16:33:05 +0000
>
>
>
> Hi,
>
> I'm calculating some distances and getting too many decimals, I just want 4 decimals, this is the code:
>
> UPDATE line SET length_km = st_length(st_transform(geom,32718))/1000 WHERE id::int between 1 and 75;
>
> and the result is for example:
>
> 75.1634098489817
>
> Is it possible to set the number of decimals in the code above?
>
> Thanks,
>
 		 	   		  


More information about the postgis-users mailing list