Author |
Topic |
dbchud
Starting Member
13 Posts |
Posted - 2010-02-24 : 10:00:52
|
Hi Haven't been able to find anything via Google etc, so hoping someone here will have an answer. Basically I'm trying to round up numbers, for examplewhat I have what I want 34.50 35.00233.11 250.00224.99 200.00 14.22 10.00etc Hope that explains what I'm after? Any help is appreciated :o)CheersGary |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-24 : 10:12:33
|
how did 34.5 got rounded to 35.00 while 14.22 got rounded to 10? then should first case be 30.00?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
dbchud
Starting Member
13 Posts |
Posted - 2010-02-24 : 10:19:39
|
Sorry, my mistake - yes, you're correct. |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-24 : 10:21:46
|
similarly for both the 200 + values shouldnt rounded value be 200.00?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
dbchud
Starting Member
13 Posts |
Posted - 2010-02-24 : 10:28:14
|
Lack of attention on my part - it's late afternoon here, almost time to go home :o)I'll try again - I have a requirment to do some calculations, which is fine, then to round up (always up, actually) the number returned. So for 34.5 I'd have to round up to 40.00. Hopefully I made a bit more sense there?Gary |
 |
|
dbchud
Starting Member
13 Posts |
Posted - 2010-02-24 : 10:33:01
|
One more example, hopefully I haven't confused anything. 12.44 - I'd like to round this up to 12.5 - would this be possible? :o) Found this: select round(12.44, 1) but it only rounds down to 12.4. Cheers |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-02-24 : 10:33:51
|
Sorry still doesnt make sense . 34.5 should round to 30.00 and not 35.00------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
dbchud
Starting Member
13 Posts |
Posted - 2010-02-24 : 10:52:51
|
Ja, agreed - but I need to always round up :o(This might work out for me:select round((12.44+.5),0) - will rtn 13.00 select round((12.12+.5),0) - will rtn 13.00 etcThanks anyway, appreciated. |
 |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2010-02-25 : 02:30:03
|
select ceiling(12.44),ceiling(12.12)MadhivananFailing to plan is Planning to fail |
 |
|
|