I replace 1.0 to 100.0, the result has two decimal place. But the value is 00 of decimal place. it seems the result still rounded.
Yes, I hinted there some magic going on. Well, not really magic, but issues related to the implicit type of numeric literals and some complicated rules for the type you get when you divide decimal values. I don't know them by heart myself.
The way I usally deal with this is to cast everything to float, and then cast the result of the division to the desired amount of decimals:
select
count(case when gender in ('Male', '1') then 1 end) N_male,
count(*) overall,
cast(
cast(count(case when gender in ('Male', '1') then 1 end) as float) /
cast(count(*) as float) as decimal(10, 2)) pct_male
from gemd.Respondents_tidy
Or in a shorter way, but less explicit:
select
count(case when gender in ('Male', '1') then 1 end) N_male,
count(*) overall,
cast(1E2 * count(case when gender in ('Male', '1') then 1 end) / count(*) as decimal(10, 2)) pct_male
from gemd.Respondents_tidy
The datatype of the literal 1E2 (which is equal to 100) is float, and then everything else is converted to float.