Rounding float values

  • Hi,

    Is there anyway of rounding a float value such as 88.125 to 88.13?

    I used teh function round(88.125, 2) however this gave me the value 88.129999999999995. How do I just get it to return a value of two decimal places?

    Cheers

    Reet

  • You can cast it as a decimal...

    declare @x float

    set @x = 88.125

    select @x, cast(@x as decimal(8, 2))

    Ryan Randall

    Solutions are easy. Understanding the problem, now, that's the hard part.

  • Ryan,

    You're a star! Thank you very much - worked a treat!

    Cheers

    Reet

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

You must be logged in to reply to this topic. Login to reply