From f0201de4cc42f5d435ec7eee3706abd776e85a1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Thu, 27 Aug 2020 14:52:57 +0200 Subject: [PATCH] Round with 1 decimal (#6715) --- src/data/weather.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/data/weather.ts b/src/data/weather.ts index 199a5e68e9..369a64ec34 100644 --- a/src/data/weather.ts +++ b/src/data/weather.ts @@ -2,6 +2,7 @@ import { SVGTemplateResult, svg, html, TemplateResult, css } from "lit-element"; import { styleMap } from "lit-html/directives/style-map"; import type { HomeAssistant, WeatherEntity } from "../types"; +import { roundWithOneDecimal } from "../util/calculate"; export const weatherSVGs = new Set([ "clear-night", @@ -135,7 +136,7 @@ export const getSecondaryWeatherAttribute = ( return ` ${hass!.localize( `ui.card.weather.attributes.${attribute}` - )} ${value} ${getWeatherUnit(hass!, attribute)} + )} ${roundWithOneDecimal(value)} ${getWeatherUnit(hass!, attribute)} `; };