Round with 1 decimal (#6715)

This commit is contained in:
Joakim Sørensen 2020-08-27 14:52:57 +02:00 committed by GitHub
parent 6cd51a318b
commit f0201de4cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ import { SVGTemplateResult, svg, html, TemplateResult, css } from "lit-element";
import { styleMap } from "lit-html/directives/style-map"; import { styleMap } from "lit-html/directives/style-map";
import type { HomeAssistant, WeatherEntity } from "../types"; import type { HomeAssistant, WeatherEntity } from "../types";
import { roundWithOneDecimal } from "../util/calculate";
export const weatherSVGs = new Set<string>([ export const weatherSVGs = new Set<string>([
"clear-night", "clear-night",
@ -135,7 +136,7 @@ export const getSecondaryWeatherAttribute = (
return ` return `
${hass!.localize( ${hass!.localize(
`ui.card.weather.attributes.${attribute}` `ui.card.weather.attributes.${attribute}`
)} ${value} ${getWeatherUnit(hass!, attribute)} )} ${roundWithOneDecimal(value)} ${getWeatherUnit(hass!, attribute)}
`; `;
}; };