Displaying an input_number to 2 decimal places

I have an input_number storing the ‘remaining oil’ in my tank. Every time the boiler stops, an automation reduces it according to the time the boiler was burning. the remaining oil is displayed in Gauge and Entity cards in Lovelace to 4 decimal places.

How can I change this to 1 or 2 decimal places?

Wrap it into a template sensor that uses something like

value: "{{ states('input_number.my_entity') | float(0) | round(2) }}"

Are thanks. I had come across that but it wasn’t rebooting because I’d missed out a ‘)’

This is my entry now.

  - platform: template
        friendly_name: "Oil Remaining"
        unit_of_measurement: "Litres"
        value_template: "{{states('input_number.oil_tank_remaining') | round(2)}}"

It’s working on the Gauge.

I’m guessing that this won’t work for the Entities card as it won’t let me edit the value when I get the tank filled up.

Correct, you can’t edit a sensor‘s value. But wouldn‘t you edit the input_number anyway?

Also: Unit of measurement should AFAIK be the symbol („l“), not the localized name.