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

Puneet Kishor punk.kish at gmail.com
Fri Oct 7 09:47:31 PDT 2011


On Oct 7, 2011, at 11:33 AM, Gery . wrote:

> 
> 
> 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?
> 

http://sqlzoo.net/howto/source/u.cgi/tip177276/postgres


You will get more mileage in your work with PostGIS and Postgres the better you get at basic SQL. Good luck.

Puneet.




More information about the postgis-users mailing list