[:-3] no longer working to cut last character(s) off attribute

I have been using this template for quite a while. But it stopped working about 4 weeks ago when I upgraded HA. The problem appears to be that [:-3] no longer works to cut the last 3 charcters of the attribute.

For example:

      solar_energy_2:
        friendly_name: "Solar 2 Energy Created Today" 
        value_template: >
          {{ '%0.2f'|format ((states.sensor.zw_066_solar_meter.attributes.total_energy_used)[:-3] | float )}} 

I need this to remove the kwh that is imbedded in the attribute. But it no longer works as of 4 weeks ago. Same with my other templates that use [:-1]

Did the format change for cutting off the last characters?