mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-25 13:57:21 +00:00
Use number format setting for attribute rows (#8844)
This commit is contained in:
parent
ad4f90c502
commit
716335df2c
@ -10,6 +10,7 @@ import {
|
|||||||
TemplateResult,
|
TemplateResult,
|
||||||
} from "lit-element";
|
} from "lit-element";
|
||||||
import checkValidDate from "../../../common/datetime/check_valid_date";
|
import checkValidDate from "../../../common/datetime/check_valid_date";
|
||||||
|
import { formatNumber } from "../../../common/string/format_number";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
import { hasConfigOrEntityChanged } from "../common/has-changed";
|
||||||
import "../components/hui-generic-entity-row";
|
import "../components/hui-generic-entity-row";
|
||||||
@ -71,6 +72,8 @@ class HuiAttributeRow extends LitElement implements LovelaceRow {
|
|||||||
.ts=${date}
|
.ts=${date}
|
||||||
.format=${this._config.format}
|
.format=${this._config.format}
|
||||||
></hui-timestamp-display>`
|
></hui-timestamp-display>`
|
||||||
|
: typeof attribute === "number"
|
||||||
|
? formatNumber(attribute, this.hass.locale)
|
||||||
: attribute ?? "-"}
|
: attribute ?? "-"}
|
||||||
${this._config.suffix}
|
${this._config.suffix}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user