Re: rounding down a number - Mailing list pgsql-novice

From Frank Bax
Subject Re: rounding down a number
Date
Msg-id 5.2.1.1.0.20070330183617.04f49a50@pop6.sympatico.ca
Whole thread Raw
In response to Re: rounding down a number  (Phillip Smith <phillip.smith@weatherbeeta.com.au>)
List pgsql-novice
100.51 will become 100.41 and round down to 100 - Are all input only one
decimal place?



At 05:56 PM 3/30/07, Phillip Smith wrote:

>Subtract .1 from the number before rounding it when you want it to round
>that way...
>
>100.5 will become 100.4 and round down.
>100.6 will become 100.5 and round up.
>Everything else will round as 'normal'.
>
>~p
>
>
>On Fri, 2007-03-30 at 14:38 -0700, Michael wrote:
>>Hi,
>>
>>I'm trying to round down any number with a half, but keep the round
>>function for all other fractions.
>>For example
>>
>>100.1 becomes 100
>>100.4 becomes 100
>>100.5 becomes 100 (this one would ordinarily round to 101)
>>100.6 becomes 101
>>100.9 becomes 101
>>
>>Thanks, Mick


pgsql-novice by date:

Previous
From: "Jim Stalewski"
Date:
Subject: Re: rounding down a number
Next
From: "Duncan Garland"
Date:
Subject: Re: rounding down a number