mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Format entity & sensor card with manual units; fix param comment typo (#14090)
This commit is contained in:
parent
0972cb4583
commit
a475b06d49
@ -34,7 +34,7 @@ export const numberFormatToLocale = (
|
||||
* Formats a number based on the user's preference with thousands separator(s) and decimal character for better legibility.
|
||||
*
|
||||
* @param num The number to format
|
||||
* @param locale The user-selected language and number format, from `hass.locale`
|
||||
* @param localeOptions The user-selected language and formatting, from `hass.locale`
|
||||
* @param options Intl.NumberFormatOptions to use
|
||||
*/
|
||||
export const formatNumber = (
|
||||
|
@ -146,7 +146,7 @@ export class HuiEntityCard extends LitElement implements LovelaceCard {
|
||||
stateObj.attributes[this._config.attribute!]
|
||||
)
|
||||
: this.hass.localize("state.default.unknown")
|
||||
: isNumericState(stateObj)
|
||||
: isNumericState(stateObj) || this._config.unit
|
||||
? formatNumber(stateObj.state, this.hass.locale)
|
||||
: computeStateDisplay(
|
||||
this.hass.localize,
|
||||
|
Loading…
x
Reference in New Issue
Block a user