Rounding up my climate state to match the Nest Thermostat

I’m rounding my temperature to 0.5 to match my Nest thermostat values.
I was able to round it but I want all .0 (like 22.0) to be shown as 22 (no decimal) but all 0.5 to still show the decimal. I’ve tried different things but nothing seems to work and my code is not pretty.
Would anyone know how to fix this?

- platform: template
  sensors:
    livingroom_current_temperature_rd:
      friendly_name: "Current Temperature Rounded"
      unit_of_measurement: °C
      value_template: >
        {{ (((state_attr('climate.living_room', 'current_temperature') | float) * 2) | round ) / 2 }}

- platform: template
  sensors:
    livingroom_current_temperature_rd5:
      friendly_name: Current Temperature Rounded to 0.5
      unit_of_measurement: °C
      value_template: >-
        {% if states('sensor.livingroom_current_temperature_rd') == 15.0 %}
          15
        {% elif states('sensor.livingroom_current_temperature_rd') == 15.5 %}
          15.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 16.0 %}
          16
        {% elif states('sensor.livingroom_current_temperature_rd') == 16.5 %}
          16.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 17.0 %}
          17
        {% elif states('sensor.livingroom_current_temperature_rd') == 17.5 %}
          17.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 18.0 %}
          18
        {% elif states('sensor.livingroom_current_temperature_rd') == 18.5 %}
          18.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 19.0 %}
          19
        {% elif states('sensor.livingroom_current_temperature_rd') == 19.5 %}
          19.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 20.0 %}
          20
        {% elif states('sensor.livingroom_current_temperature_rd') == 20.5 %}
          20.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 21.0 %}
          21
        {% elif states('sensor.livingroom_current_temperature_rd') == 21.5 %}
          21.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 22.0 %}
          22
        {% elif states('sensor.livingroom_current_temperature_rd') == 22.5 %}
          22.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 23.0 %}
          23
        {% elif states('sensor.livingroom_current_temperature_rd') == 23.5 %}
          23.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 24.0 %}
          24
        {% elif states('sensor.livingroom_current_temperature_rd') == 24.5 %}
          24.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 25.0 %}
          25
        {% elif states('sensor.livingroom_current_temperature_rd') == 25.5 %}
          25.5
        {% elif states('sensor.livingroom_current_temperature_rd') == 26.0 %}
          26
        {% else %}
          Unknown
        {% endif %}

This code in lovelace does not show numbers but the name of the sensor and that’s it. So in this case you read: “sensor.livingroom_current_temperature_rd5”