Re: rounding down a number

From: Phillip Smith <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
To: Michael <mmcelarn(at)hotmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: rounding down a number
Date: 2007-03-30 21:56:02
Message-ID: 1175291762.4929.15.camel@phillip-desktop
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Jim Stalewski 2007-03-30 22:30:15 Re: rounding down a number
Previous Message Michael 2007-03-30 21:38:53 rounding down a number