Search Postgresql Archives

Re: a very primitive question about division

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks.  So  round(before1550/colfreq::numeric, 2)  produces the desired result. 

 

The explanations and examples of string functions in the Postgres documentation are a model of clarity. The explanations and examples of basic arithmetic operations  are not.  There is room for improvement there.

 

From: "David G. Johnston" <david.g.johnston@xxxxxxxxx>
Date: Wednesday, March 7, 2018 at 11:23 AM
To: Martin Mueller <martinmueller@xxxxxxxxxxxxxxxx>
Cc: "pgsql-general@xxxxxxxxxxxxxxxxxxxx" <pgsql-general@xxxxxxxxxxxxxxxxxxxx>
Subject: Re: a very primitive question about division

 

Given two values defined as integers, how do I divide one by the other and get an answer with two decimals, e.g 3 /4 = 0.75.

 

​Case one of them to numeric.

 

​select 3/4::numeric

​David J.​

 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux