if hour is a number, then if it can only be an integer:
select count(distinct coalesce(hour, 0.1)) cnt from test;
otherwise if it can be any floating point, change NULL to a char string.
eg
select count(distinct coalesce(to_char(hour), 'a')) cnt from test;