ESPhome strange rounding issues

I have an ESPHome configuration with several sensors, and I’m running into some strange rounding issues.
I hope someone can point me in the right direction. What is the correct way?

The value of id(gw_registers)[42] is 236, and I want to display it as 23.6. In Home Assistant this seems to work correctly, but when I look under state in the developer tools, I see 23.6000003814697.

Screenshot from HA

// Temperature
float inverter_temp = id(gw_registers)[42]; // / 10.0;

id(sensor_inverter_temp).publish_state(inverter_temp);

I’ve tried dividing the value within the float and inside the sensor itself, but it still shows the long number in the state.

sensor:
  - platform: template
    device_class: temperature
    state_class: measurement
    name: "Temperature"
    id: sensor_inverter_temp
    unit_of_measurement: °C    
    entity_category: diagnostic
    accuracy_decimals: 1
    filters:
      - round: 1



  - platform: template 
    name: "Temperature"
    id: sensor_inverter_temp
    unit_of_measurement: °C    
    entity_category: diagnostic
    accuracy_decimals: 1
    filters:
      - lambda: |-
          return roundf(x / 10.0 * 10.0) / 10.0;

If this has no impact on logging (database) and such,

does it matter where I divide by 10?

Here:

- platform: template
  device_class: temperature
  state_class: measurement
  name: "Temperature"
  id: sensor_inverter_temp
  unit_of_measurement: °C    
  entity_category: diagnostic
  filters:
    - multiply: 0.1
    - round: 1

Or earlier when assigning the float

float inverter_temp = id(gw_registers)[42] / 10.0;

23.6 isn’t exactly representable in a 32 bit float.

The developer tools state is correctly reporting the actual value; the user interface is displaying it in a human-friendly way as desired, so what’s the problem?