Home Forums SQL Server 7,2000 T-SQL Problem in converting float to varchar RE: Problem in converting float to varchar

  • I tried the below code

    declare @d float

    declare @d1 float

    select @d = 34343.454

    select @d1 = 676.1566545

    select cast (@d as varchar(50))

    select cast (@d1 as varchar(50))

    I got the below output.

    34343.453999999998

    676.15665449999995

    karthik