Viewing 15 posts - 4,051 through 4,065 (of 6,036 total)
There is rounding for this.
But I don't want to lose a cent because BR produces wrong result.
June 13, 2007 at 4:34 am
David,
if you are given with number 1.0450000000000001 (or 2/3) but you have only DECIMAL(18,6) storage for this, how can you produce right result from Bankers Rounding?
Can you post some...
June 12, 2007 at 9:25 pm
That code did not supply 2/3.
It supplied (in your terms) precise number 0.66666666 which is < 2/3.
I'm waiting for a code supplying 2/3 to BR function.
June 12, 2007 at 9:18 pm
But it can be used in stored procedure... ![]()
Yes, you cannot use SP call in select statement, but if you're bad enough to pass...
June 12, 2007 at 8:56 pm
Still waiting for the code supplying 2/3 to BR function as a parameter.
June 12, 2007 at 7:59 pm
I know at least one another person in this thread who thinks .666 is proper representation for 2/3. So, I'm not the only one.
And I know that this representation is...
June 12, 2007 at 7:58 pm
Jacek0, if you read again my posts from the beginning you'll see that I did not try to stop anybody from using BR in accounting where it's required (btw, it's...
June 12, 2007 at 7:40 pm
There is no inbuilt ROUND()
Where did you see any reference about built-in ROUND() in 2./3?
Result 0.666000 is correct if you take into consideration actual precision of the value.
You've got 3...
June 12, 2007 at 7:18 pm
Sorry David,
error was not on my side.
Error was in absence of documenting the changes in the function usage.
It's developer's fault, not user's.
June 12, 2007 at 7:01 pm
Sorry, there was no comment about change in using of parameter.
I tried:
DECLARE
@enumerator DECIMAL(38, 12)
,@denominator DECIMAL(38, 12)
SELECT
@enumerator = 5
,@denominator = 111.111
SELECT
dbo.fn_BRound2(@enumerator/@denominator, 2)
,Round(@enumerator/@denominator,2)
Result:
.0400.050000
Still need to try harder.
June 12, 2007 at 6:58 pm
> Banker's rounding, written properly will return the exact same results as traditional rounding for 2/3. I've said that repeatedly now, and I won't be changing my mind, but keep...
June 12, 2007 at 4:21 pm
Don't change topic.
It was not about result of ROUND.
It was about valid decimal representation of 2/3.
What ROUND() is doing in you post?
P.S. David, you're starting to make funny noises.
Control yourself.
June 12, 2007 at 4:18 pm
Here is the need to provide for:
select dbo.fn_BRound(10./7998*1000, 100)
June 12, 2007 at 4:13 pm
What do you think is the result of
select 2./3000 * 1000
Is it actually 2/3?
Is it valid representation for 2/3?
Now try with
select 10./7998*1000
How precise is your result?
Is it actually...
June 12, 2007 at 4:05 pm
"So,
WHY
0.666 is valid 3 digits precision representation of 2/3"
It's not. The valid 3 digit precision representation of 2/3 is 0.667. Did the devil make you do that?
</I?
Really?
Did you see numbers...
June 12, 2007 at 3:58 pm
Viewing 15 posts - 4,051 through 4,065 (of 6,036 total)