Skip to content

Commit

Permalink
Minor cleanup of precision number format handling (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
benct committed Dec 17, 2021
1 parent 0895fc4 commit c0a41ad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ class MultipleEntityRow extends LitElement {
if (config.format.startsWith('precision')) {
const unit = entityUnit(stateObj, config);
const precision = parseInt(config.format.slice(-1), 10);
return `${formatNumber(parseFloat(value).toFixed(precision))}${unit ? ` ${unit}` : ''}`;
const formatted = formatNumber(parseFloat(value).toFixed(precision), this._hass.language);
return `${formatted}${unit ? ` ${unit}` : ''}`;
}
return value;
}
Expand Down

0 comments on commit c0a41ad

Please sign in to comment.