1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-05-21 23:48:58 +01:00

Add UOM to stats chart, fix coloring of bands (#9665)

This commit is contained in:
Bram Kragten
2021-07-31 20:36:27 +02:00
committed by GitHub
parent 0f16ba9325
commit e07ac52356
5 changed files with 105 additions and 50 deletions
+4 -1
View File
@@ -78,7 +78,10 @@ const getDefaultFormatOptions = (
num: string | number,
options?: Intl.NumberFormatOptions
): Intl.NumberFormatOptions => {
const defaultOptions: Intl.NumberFormatOptions = options || {};
const defaultOptions: Intl.NumberFormatOptions = {
maximumFractionDigits: 2,
...options,
};
if (typeof num !== "string") {
return defaultOptions;