2017-01-13 32 views
0

在PostgreSQL中,我使用函數round,但它不返回decimal點。看例子postgres中數值的舍入

select round(10.65) 

返回11,但實際上我需要11.00。

我也試過

select round(10.65, 2) 

並返回10.65。

如何在PostgreSQL中返回帶有兩個小數點的數值?

我想這樣的輸出select round(10.65)應該返回11.00。如何讓它成爲可能?

回答

3

我認爲你應該這樣做:

select round(round(10.65),2); 
+0

感謝名單,它的工作.. – Bipin