Decimals for entity shown in notification

Hi all,

I have a notification which sends me the value of a entity but with too many decimals. How do I define how many decimals i want?

Please don’t post pictures of text. Post the text properly formatted for the forum with either the </> button or by surrounding the post in three backticks. See: https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

I could have shown you where to put this |round(2) but I cant copy and paste text from your image.

{{states('sensor.xxx') |round (0,default = 0)}}

Sorry but I couldn’t figure put how to post the text rightly formatted.

Use this

This method, as Tom pointed out expedites resolutions. No one will type out code from a pic.

Thanks! This gives me a price of 0 tho even tho it’s 1,98?

Change the round to your liking

|round (2 ,default = 0)

Oh wait i haven’t put in the sensor. Sorry!

That, and putting in the sensor name did it. Thanks!

1 Like