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

From Phillip Smith
Subject Re: rounding down a number
Date
Msg-id 1175291762.4929.15.camel@phillip-desktop
Whole thread Raw
In response to rounding down a number  ("Michael" <mmcelarn@hotmail.com>)
Responses Re: rounding down a number  (Frank Bax <fbax@sympatico.ca>)
List 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 by date:

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