Re: Unexpected result using floor() function - Mailing list pgsql-general

From Frank Millman
Subject Re: Unexpected result using floor() function
Date
Msg-id D16325C74D4B4FCD8C0A122BFFBBEA5C@FrankLaptop
Whole thread Raw
In response to Re: Unexpected result using floor() function  (Francisco Olarte <folarte@peoplecall.com>)
List 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, F
rancisco
 
Frank
 

pgsql-general by date:

Previous
From: Francisco Olarte
Date:
Subject: Re: Unexpected result using floor() function
Next
From: Johann Höchtl
Date:
Subject: Re: Full text search question: "01.Bez." --> "Erster Bezirk"