Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)

  • Reply To: Banker''s rounding in T-SQL (like Math.Round in .NET)

    I like this version better, because it does not have the magic constant "0.005" in it:

    create function dbo.RoundToEven(@num numeric(38,19)) returns decimal(19,2)
    begin
    return case
    when round(@num,...
  • Reply To: Banker''s rounding in T-SQL (like Math.Round in .NET)

    @GrassHopper's solution does not work for negative numbers, so here's his version that does work for negative numbers:

    create function dbo.RoundToEven(@num numeric(38,19)) returns decimal(19,2)
    begin
    return case
    ...
  • Viewing 3 posts - 1 through 3 (of 3 total)