G
Guest
I'm trying to determine the best approach for rounding in an application I'm
building. Unfortunately it appears as though SQL Server and VB.NET round in
different ways.
SQL Server
select round(123.465,2)
returns
123.470
Which I think is correct.
VB.NET
Math.Round(123.465, 2)
returns
123.46
Through online help I have read that the VB.NET way of doing it is "called
rounding to nearest, or banker's rounding."
I guess my first question is what is correct (when determining Tax or Sale
prices)?
My next question is what is the best approach for standarizing? Can I make
SQL Server act like VB.NET or VB.NET act like SQL Server?
Are there additional functions either in SQL Server or VB.NET that I am
missing?
Also it appears as if the behavior is consistent throughout the VB.NET
environment (formatcurrency and formatpercent).
There are certain parts of the applicaiton where it makes sense for SQL
Server to calculate some of the numbers and other where it makes sense for
VB.NET to.
Thanks
building. Unfortunately it appears as though SQL Server and VB.NET round in
different ways.
SQL Server
select round(123.465,2)
returns
123.470
Which I think is correct.
VB.NET
Math.Round(123.465, 2)
returns
123.46
Through online help I have read that the VB.NET way of doing it is "called
rounding to nearest, or banker's rounding."
I guess my first question is what is correct (when determining Tax or Sale
prices)?
My next question is what is the best approach for standarizing? Can I make
SQL Server act like VB.NET or VB.NET act like SQL Server?
Are there additional functions either in SQL Server or VB.NET that I am
missing?
Also it appears as if the behavior is consistent throughout the VB.NET
environment (formatcurrency and formatpercent).
There are certain parts of the applicaiton where it makes sense for SQL
Server to calculate some of the numbers and other where it makes sense for
VB.NET to.
Thanks