Additional number formatting (#7763)

This commit is contained in:
Josh McCarty
2020-11-25 03:37:58 -07:00
committed by GitHub
parent 1d13947e71
commit 7403405d12
13 changed files with 179 additions and 59 deletions

View File

@@ -21,6 +21,7 @@ import { timerTimeRemaining } from "../../common/entity/timer_time_remaining";
import { HomeAssistant } from "../../types";
import "../ha-label-badge";
import { UNAVAILABLE, UNKNOWN } from "../../data/entity";
import { formatNumber } from "../../common/string/format_number";
@customElement("ha-state-label-badge")
export class HaStateLabelBadge extends LitElement {
@@ -115,7 +116,7 @@ export class HaStateLabelBadge extends LitElement {
: state.state === UNKNOWN
? "-"
: state.attributes.unit_of_measurement
? state.state
? formatNumber(state.state, this.hass!.language)
: computeStateDisplay(
this.hass!.localize,
state,