I experience this template workaround as non-intuitive.
A sensor stands for data, a card/badge stands for representation of that data to the end-user. I don’t want to limit the digits in the integration as you then lose accuracy.
The process is non-intuitive, as I must create a new (forked) sensor with the only purpose to represent the value on a card in lovelace. This gives me a bad user experience. For my solar panels, I now need to have two template sensors: one for the badge (zero digits) and one for a sensor card (1 digit). This means extra data in your database/list with all sorts of “postfix sensors” (e.g.
sensor.solaredge_current_power_1digit). You could consider as database pollution, but at least increased maintenance of your data.
I don’t want to ignore that there are other use cases that justify the creation of a template sensor, but to my opinion it should be an option on the card to simply limit the number of digits.
It now works, but hope that in the future it would be possible to enhance this.