Re: Unexpected result using floor() function

From: "Frank Millman" <frank(at)chagford(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Re: Unexpected result using floor() function
Date: 2016-03-15 10:48:44
Message-ID: D16325C74D4B4FCD8C0A122BFFBBEA5C@FrankLaptop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Tue, Mar 15, 2016 at 12:02 PM, Francisco Olarte wrote:

> Hi Frank:
>
> This may byte you any day, so I wuld recommend doing
>
> s=> select v, pg_typeof(v) from (select floor(4.725 * power(cast(10 as
> numeric), 2) + 0.5)) as aux(v);
> v | pg_typeof
> -----+-----------
> 473 | numeric
> (1 row)
>
> which makes your intention clear.

Good advice. Thank you, Francisco
Frank

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Johann Höchtl 2016-03-15 13:35:35 Re: Full text search question: "01.Bez." --> "Erster Bezirk"
Previous Message Francisco Olarte 2016-03-15 10:02:36 Re: Unexpected result using floor() function