Is it possible to format (e.g decimal places) an entity? #986
-
One of my sensors reports a ridiculous number of decimal places to HA. I would like to include its value as a sub-button, however I'm trying to figure out how to format the number of decimal places. Looking through the documentation, I think there is a way with some CSS styles. I have the following, but cannot figure out how to format the number of decimal places reported
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes that is possible. So it becomes:
More info: If this solves your issue, please mark this as solved. |
Beta Was this translation helpful? Give feedback.
Yes that is possible.
Just add
.toFixed(2)
to the code for 2 decimals.So it becomes:
More info:
https://www.w3schools.com/jsref/jsref_tofixed.asp
If this solves your issue, please mark this as solved.