Re: rounding down a number

Поиск
Список
Период
Сортировка
От Frank Bax
Тема Re: rounding down a number
Дата
Msg-id 5.2.1.1.0.20070330183617.04f49a50@pop6.sympatico.ca
обсуждение исходный текст
Ответ на Re: rounding down a number  (Phillip Smith <phillip.smith@weatherbeeta.com.au>)
Список 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 по дате отправления:

Предыдущее
От: "Jim Stalewski"
Дата:
Сообщение: Re: rounding down a number
Следующее
От: "Duncan Garland"
Дата:
Сообщение: Re: rounding down a number