Viewing 15 posts - 181 through 195 (of 294 total)
It really is quite simple. We want a function that matches the following rules:
* Decide which is the last digit to keep.
* Increase it by 1 if the next...
June 14, 2007 at 5:09 pm
SELECT dbo.fn_BRound(654.945,100) -- Wrong - 654.95
Which is why we are here in thre first place.
Dave J
June 14, 2007 at 9:53 am
This is fun.
I read it carefully.
Especially this:
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=370393&p=5
Try reading http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=373178&p=1
I was asked for, and supplied the latest iteration. That's where you find it.
What made you change datatype of the...
June 14, 2007 at 7:16 am
Ermm...
select dbo.fn_Bround(2.265,100) union
select dbo.fn_Bround(612.945,100)
---------------------
2.2600
612.9500
(2 row(s) affected)
Yes?
Guys, are you really programmers?
Personally, no. I'm a DBA Manager.
Now off to the other thread to reply to yet more
June 14, 2007 at 7:07 am
David Jackson, you need to thank Sergiy, as he just proved that your function works perfectly to his expectations.
Thanks Sergiy
Dave J
June 14, 2007 at 6:02 am
Isn't double precision a synonym of float?
So I believe.
Do you use actually use double precision in the function?
Yes. Proof once again you do not read these posts carefully. Go on,...
June 14, 2007 at 5:34 am
Your changing the rules again.
So, please use datatypes you're using for your function.
OK.
select (cast(2 as double precision)/ cast(3 as double precision)) * 3
Dave
June 14, 2007 at 4:57 am
environment = SQL2000 Query Analyzer
select (cast(2 as float)/ cast(3 as float)) * 3
Result
2.0
June 14, 2007 at 3:46 am
I can't test this now, but his "Try harder." comment, when the error was on his part on how he called the function, got to me . Sorry.
June 12, 2007 at 5:40 pm
Sergiy
you was politely asked to stay out of this thread. The reason you got an error was because you are using Lynns function, which does not take the same...
June 12, 2007 at 5:05 pm
Certainly. This uses Double Precision, which I've never heard of in T-SQL until recently, but it still has trouble with certain values.
Although it does pass...
June 12, 2007 at 11:48 am
closest cent
---------------------
.1200
is the result you get when you use 100000
And it is expected. This is why bankers rounding is also called the round to even method....
June 11, 2007 at 5:55 am
June 11, 2007 at 5:11 am
Viewing 15 posts - 181 through 195 (of 294 total)