Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZFmS-0001dA-B8 for pgsql-general@arkaria.postgresql.org; Tue, 18 Dec 2018 13:51:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gZFmR-0005Xm-0z for pgsql-general@arkaria.postgresql.org; Tue, 18 Dec 2018 13:51:27 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZFmP-0005V4-1x for pgsql-general@lists.postgresql.org; Tue, 18 Dec 2018 13:51:26 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gZFmL-0001Qd-63 for pgsql-general@postgresql.org; Tue, 18 Dec 2018 13:51:24 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 79FEC238EF; Tue, 18 Dec 2018 08:51:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 18 Dec 2018 08:51:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=P 3fHEjhh/LNWB4No6itACmoJHJu6hI/SvhCJGID8AS4=; b=AdsdqkPi1Sb8epYMS hUub3CEZhL5+4ZWoMGXiibZ+igJgaIPNOV24l6741rdqBLpZNkmt2cWDZAzAkYqj NgwHgk4xhVOFI14emVqhGHyV5QcwBfUm0DByvbcOKC/iTgatNq4S4yVWYwhU6CI8 C8YqYj9aRWk/gRsAKI6ByDSSvixjeyVc00yYrMs0acrH0UIQ65qGh0SAUhoEPL22 yCXGA6m5eUBLZ8nNEAJ509KfAwlrdB/4xu0oJsTDEl0JKrvDf3LcLiEB5AkP+75o 6sjfL2tUJPv+L8k4mbw519ul4XjOQvYUcl74JHp8AarUkB4A2EyG26msQ4lbXbSv HUa0w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=P3fHEjhh/LNWB4No6itACmoJHJu6hI/SvhCJGID8A S4=; b=VIUjuKraDHV7ocR65A9zRP8jR3kfoJz5HatLIDSE7QxO8xc6S3EWxr4Z3 6oSUR7Le9OBRz3c6DPBsprYfXvnwa9KQAWtz8KySffDB4m6uk2pfQ5zdtUY/GeaG kYjKMjf0j7pN3xQpRaISXj0tEHHDooVX/mgEaAAY7wdcU9ilJ/cbEh7DJOlZczjW WAO9Aq1KUFtrTHw7VItFSz2H28jBoo8Fna8+aXSDYdu71+YKNN5P7RtXHLpIeVfC 6/vnRdyctajhA3OceewrHCv9+MtA8YCVwHqbTBZp/eNsyBxlf1IXK7KfV8sLgJ// 8bYSZ38l3e7CShPN0s3sOEYVZz0Fw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedtkedrudeikedgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfquhhtnecuuegrihhlohhuthemucef tddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekredttdefjeenucfhrhhomh eptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghv vghrrdgtohhmqeenucfkphepjedurddvuddvrddufeegrdefnecurfgrrhgrmhepmhgrih hlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehl uhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.134.3]) by mail.messagingengine.com (Postfix) with ESMTPA id 73CD5E4384; Tue, 18 Dec 2018 08:51:17 -0500 (EST) Subject: Re: Format an Update with calculation To: bret_stern@machinemanagement.com, pgsql-general References: <1545117297.4397.18.camel@dell990-bret-centos.localdomain> From: Adrian Klaver Message-ID: <9c8f99cc-241e-531a-0474-7956d6f718b8@aklaver.com> Date: Tue, 18 Dec 2018 05:51:16 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: <1545117297.4397.18.camel@dell990-bret-centos.localdomain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/17/18 11:14 PM, Bret Stern wrote: > My statement below updates the pricing no problem, but I want it to be > formatted with 2 dec points eg (43.23). > > Started playing with to_numeric but can't figure it out. Lots of > examples with to_char in the > manual, but still searching for answer. > > Can it be done? > > I want suggested_retail_price to be formatted to 2 decimal points > > UPDATE im_ci_item_transfer >    SET suggested_retail_price=(suggested_retail_price + > (suggested_retail_price * .13)) > WHERE item_code='0025881P2'; > > Feeling lazy, sorry guys In addition to what Pavel posted: select round(43.2335, 2); round ------- 43.23 -- Adrian Klaver adrian.klaver@aklaver.com