Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

Next:From: Jim StalewskiDate: 2007-03-30 22:30:15
Subject: Re: rounding down a number
Previous:From: MichaelDate: 2007-03-30 21:38:53
Subject: rounding down a number

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group