Search Postgresql Archives

Re: Format an Update with calculation

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

 



>>>>> "Bret" == Bret Stern <bret_stern@xxxxxxxxxxxxxxxxxxxxx> writes:

 Bret> My statement below updates the pricing no problem, but I want it
 Bret> to be formatted with 2 dec points eg (43.23).

UPDATE ...
   SET suggested_retail_price = round(suggested_retail_price*1.13, 2)
 WHERE ...

assuming suggested_retail_price is already of type "numeric".

You could also have given the columm a type of numeric(18,2) or similar,
which would round all assigned values to 2 places.

-- 
Andrew (irc:RhodiumToad)




[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