Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Revert fixed rounding of values
  • Loading branch information
Rocka84 authored Mar 3, 2022
1 parent 5901b68 commit 4dea77a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dual-gauge-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,12 @@ class DualGaugeCard extends HTMLElement {
_getEntityStateValue(entity, attribute) {
if (!attribute) {
if(isNaN(entity.state)) return "-" ; //check if entity state is NaN
else return (Math.round(entity.state*10)/10); //rounds the value to 1 decimal place
else return entity.state;
}

// return entity.attributes[attribute];
if(isNaN(entity.attributes[attribute])) return "-" ; //check if entity attribute is NaN
else return (Math.round(entity.attributes[attribute]*10)/10); //rounds the value to 1 decimal place
else return entity.attributes[attribute];
}

_calculateRotation(value, gaugeConfig) {
Expand Down

0 comments on commit 4dea77a

Please sign in to comment.