View Single Post
Old 03-15-2008, 12:58 PM  
MichaelP
Registered User
 
Industry Role:
Join Date: Aug 2003
Location: QWEBEC Corporate Office
Posts: 7,124
SQL Need Help! (round($VAR, 1))

Ok I,m working on something and I'm a bit puzzled here

with ROUND : (round($VAR, 1))

I try to round Var numbers at the closest .5 with only one decimal

Now I can have :

$var = 1.01 gives 1
$var = 1.23 gives 1.3
$var = 1.42 gives 1.4
$var = 1.77 gives 1.8

What I'd like :

$var = 1.01 gives 1
$var = 1.23 gives 1
$var = 1.42 gives 1.5
$var = 1.77 gives 2

Well, you get the idea... So in a nutshell, I'd like my result to be at the closest .5

I also tried Ceil and Floor

Is it something possible ?

Txs Forward

Last edited by MichaelP; 03-15-2008 at 01:00 PM..
MichaelP is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote