Skip to content

Commit

Permalink
fix: legend unit percent w/o whitespace (#1191)
Browse files Browse the repository at this point in the history
if UoM = "%", then do not use a whitespace as a delimeter.
  • Loading branch information
ildar170975 authored Jan 12, 2025
1 parent f5261d9 commit 9f5cfd9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ class MiniGraphCard extends LitElement {
const { show_legend_state = false } = this.config.entities[index];

if (show_legend_state) {
legend += ` (${this.computeState(state)} ${this.computeUom(index)})`;
if (this.computeUom(index) === '%') {
legend += ` (${this.computeState(state)}${this.computeUom(index)})`;
} else {
legend += ` (${this.computeState(state)} ${this.computeUom(index)})`;
}
}

return legend;
Expand Down

0 comments on commit 9f5cfd9

Please sign in to comment.