Re: rounding down a number

Поиск
Список
Период
Сортировка
От Phillip Smith
Тема Re: rounding down a number
Дата
Msg-id 1175291762.4929.15.camel@phillip-desktop
обсуждение исходный текст
Ответ на rounding down a number  ("Michael" <mmcelarn@hotmail.com>)
Ответы Re: rounding down a number  (Frank Bax <fbax@sympatico.ca>)
Список pgsql-novice
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



*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to the addressee. If you are not the addressee indicated in this message or responsible for delivery of the message to such person, you may not copy or deliver this message to anyone, and you should destroy it and kindly notify the sender by reply email.

Information in this message that does not relate to the official business of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta. Weatherbeeta, its employees, contractors or associates shall not be liable for direct, indirect or consequential loss arising from transmission of this message or any attachments

В списке pgsql-novice по дате отправления:

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