mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-26 20:42:54 +00:00
Round with 1 decimal (#6715)
This commit is contained in:
@@ -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<string>([
|
||||
"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)}
|
||||
`;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user