-
Aug 12th, 2012, 05:55 AM
#1
Thread Starter
Fanatic Member
Help with Decimal Roundings
hi Guys , i am a bit stuck here
i have this value "0.833333333333333"
and i want the asnwer to be 83 , i tried this
Code:
SELECT ROUND(0.833333333333333,2)
but it does not work
-
Aug 12th, 2012, 11:48 AM
#2
Re: Help with Decimal Roundings
try:
Code:
SELECT ROUND(0.833333333333333 * 100,0)
"It's cold gin time again ..."
Check out my website here.
-
Aug 13th, 2012, 05:31 AM
#3
Re: Help with Decimal Roundings
This will bring back "83".
select convert(decimal(12,0),ROUND(0.833333333333333 * 100,0))
-
Aug 13th, 2012, 07:33 AM
#4
Re: Help with Decimal Roundings
"but it does not work" -- I beg to differ... it does work... it's doing exactly what you told it to do... round to two decimal places (.83). just so happens that the result isn't what you want... (83)
There's two solutions... 1) multiply it by 100 then round to 0 decimal places...as the previous posters did.... or, round to 2 decimal places THEN multiply by 100.
-tg
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|