Home Forums SQL Server 7,2000 T-SQL Round to Even (aka Banker''s Rounding) - The final function RE: Round to Even (aka Banker''''s Rounding) - The final function

  • Whole bunch of examples where FLOAT (DOUBLE PRECISION) fails is in 1st topic.

    Regarding second one:

    DECLARE

    @enumerator DECIMAL(38, 12)

    ,@denominator DECIMAL(38, 12)

    SELECT

    @enumerator = 50

    ,@denominator = 111.111

    SELECT @enumerator/@denominator,

    dbo.fn_BRound2(@enumerator/@denominator, 100)

    ,Round(@enumerator/@denominator,2)

    Server: Msg 8115, Level 16, State 6, Procedure fn_Bround2, Line 7

    Arithmetic overflow error converting float to data type numeric.

    Try harder.

    _____________
    Code for TallyGenerator