This is not beautiful but i think it works
Assuming formatting A1
1. First format A1 as Number with 1 decimal place
2. Go to Conditional Formatting
New Rule
Use a formula to.. (the last option)
and insert this formula
=SEARCH(".0",TEXT(A1,"0.0"))
Click the Format button
and pick Number with 0 decimal places
Ok, Ok
done
Now you can use the Format Painter to apply the format to other cells.
HTH