Skip to content

Commit 080840b

Browse files
committed
Add number formatting to invert and position options (benct#220)
1 parent 8dc309f commit 080840b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/entity.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ export const entityStateDisplay = (hass, stateObj, config) => {
5555
} else if (config.format === 'kilo') {
5656
value = formatNumber(value / 1000, hass.locale, { maximumFractionDigits: 2 });
5757
} else if (config.format === 'invert') {
58-
value = value - value * 2;
58+
value = formatNumber(value - value * 2, hass.locale);
5959
} else if (config.format === 'position') {
60-
value = 100 - value;
60+
value = formatNumber(100 - value, hass.locale);
6161
}
6262
return `${value}${unit ? ` ${unit}` : ''}`;
6363
}

0 commit comments

Comments
 (0)