select Sample, Round( ( Sample + Sign( Sample ) * 0.125 ) * 4, 0, 1 ) / 4.0 as Rounded from ( values ( 0.0 ), ( 0.1 ), ( 1.125 ), ( 0.25 ), ( 10.5 ), ( -0.75 ), ( -0.875 ), ( -1.12 ), ( -1.125 ) ) as Samples( Sample )
Note that ROUND can be used to trim the fractional part of a value regardless of sign. FLOOR will always return a value equal to or less than the original value, which can be problematic when the value is negative.
source share