Notification sent to phone, fix number of decimal places and calculate cost

Hi All
I have an automation that sends a notification when my car charge period completes and how much electricity was used. Its functional but Id like to set the number of decimal places reported and I cant see how to accomplish this. Additionally I`d like to give the cost of charge too, since the charge price is fixed at 8p per kWh. Some pointers would be gratefully appreciated, Pete
Charge OFF “{{states(‘sensor.amicharge_today_s_consumption’) }}” kWh Today

Hi @PeteG2022

How about

“{{states(‘sensor.amicharge_today_s_consumption’) | round(0) }}” kWh Today

and this

“£{{states(‘sensor.amicharge_today_s_consumption’) * 0.08 | round(2) }}” Today
1 Like

Hello Pete,

To set precision of any numeric entity, go to the gear and set the precision…