junkfix / numberbox-card

Replace input_number sliders with plus and minus buttons
109 stars 9 forks source link

is it possible to round a number in the secondary_info field? #94

Closed valantur closed 1 year ago

valantur commented 1 year ago

This isn't really a bug but a question: I have a sensor with a value of "xx.xxxxxxx" and I would like to display it in the secondary_information field but rounded to two decimals.

'Now: %sensor.thermostat_current_away_temp:state °F' shows Now: 71.388377 °F and I would like it to show Now: 71.39°F

I know there are other ways to achieve this (like creating a template sensor and rounding that one) but I wonder if there is a way to do it via HTML or whatever else, directly from the numberbox card.

Thanks!

ildar170975 commented 1 year ago

I am also interested in this. The card seems to use neither jinjia nor js for addressing entities, so corresponding operations seem to be not available here.

pos-ei-don commented 1 year ago

Great Feature, but does not seem to work on states? Could only get it working on attributes.

Caligo82 commented 1 year ago

This update broke my numberbox card. Had to revert to the previous one...

ildar170975 commented 1 year ago

@Caligo82 Could you elaborate? Probably better to create an issue with a detailed description.

Caligo82 commented 1 year ago

Sorry it seems it was a caching issue with the Cloudflared plugin. My bad. Thanks for the fast reply!

pos-ei-don commented 1 year ago

Created a new issue as i also see the problems with cloudflaire.