используйте на case
case format(@number,0)=@number
when 1 then format(@number,0)
else
case format(@number,1)=@number
when 1 then format(@number,1)
else @number
end
end
или if
if (format(@number,0)=@number, format(@number,0),
if (format(@number,1)=@number, format(@number,1), @number))