Skip to content

Commit

Permalink
Merge pull request #23 from MindFreeze/fix-hideunit
Browse files Browse the repository at this point in the history
  • Loading branch information
iantrich authored Nov 14, 2021
2 parents 5e51c3b + 5ce394a commit 0f49183
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions bignumber-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ class BigNumberCard extends HTMLElement {
}
root.querySelector("ha-card").style.setProperty('--bignumber-fill-color', `${this._getStyle(entityState, config)}`);
root.querySelector("ha-card").style.setProperty('--bignumber-color', `${this._getColor(entityState, config)}`);
if (config.hideunit==true)
{ root.getElementById("value").textContent = `${entityState}`; }
else
{ root.getElementById("value").textContent = `${entityState} ${measurement}`; }
this._entityState = entityState
let value = (config.round == null ? entityState : parseFloat(entityState).toFixed(config.round))
root.getElementById("value").textContent = `${value} ${measurement}`;
if (config.hideunit==true)
{ root.getElementById("value").textContent = `${value}`; }
else
{ root.getElementById("value").textContent = `${value} ${measurement}`; }
if (this.isNoneConfig){
if (isNaN(value)) {
if (config.noneString) {
Expand Down

0 comments on commit 0f49183

Please sign in to comment.