Lets say you have a table like this:
CREATE TABLE [dbo].[Table_1]
(
[test] [numeric](18, 2) NULL
) ON [PRIMARY]
The query below should give you results like you want:
SELECT
Test,
CASE WHEN (Test % 1) > 0 THEN CAST(Test AS FLOAT) ELSE (CAST(Test AS INT)) END AS Output
FROM Table_1