Hey Guys,
Spent last night making a nice simple weather template widget. I am happy with it but for some reason, I can’t work out how to change the temperatures to a single decimal, or even a round number. I searched the forums and am now stumped lol.
I want the temperatures shown as 20.1°C or even just 20°C instead of 20.96°C.
I added the items through paper UI
Here is my template:
<style>
.rzslider .rz-pointer {
background: hsl(47, 100%, 50%);
}
.condition {
font-size: 32px;
text-transform: capitalize;
margin-top: -10px;
}
.title {
font-size: 14px;
padding-top: 7px;
}
.indoor {
border-bottom: 5px solid #243a50;
width: 96%;
margin-left: auto;
margin-right: auto;
}
.indoortemp {
padding-bottom:10px;
font-size: 32px;
}
.weather {
border-bottom: 5px solid #243a50;
padding-top: 10px;
width: 96%;
margin-left: auto;
margin-right: auto;
}
.forecast {
padding-top: 10px;
width: 95%;
margin-left: auto;
margin-right: auto;
}
.result {
font-size: 32px;
}
img.icon {
padding: 0px !important;
margin-top: -10px;
}
</style>
<div class="row">
<div class="indoor">
<div class="title">INDOOR TEMP</div>
<div class="indoortemp">{{itemValue('HueTemperatureSensor1_Temperature')}}</div>
</div>
<div class="weather">
<div class="title">WEATHER NOW</div>
<div class="result">{{itemValue('LocalWeatherAndForecast_Current_OutdoorTemperature')}}</div>
<div class="condition">{{itemValue('LocalWeatherAndForecast_Current_WeatherCondition')}}</div>
<img class="icon" height="100%" ng-src="{{itemValue('LocalWeatherAndForecast_Current_Icon')}}" src="{{itemValue('LocalWeatherAndForecast_Current_Icon')}}"></img>
</div>
<div class="forecast">
<div class="title">FORECAST FOR {{itemValue('LocalWeatherAndForecast_ForecastHours06_ForecastTime') | date:'h:mma'}}</div>
<div class="result">{{itemValue('LocalWeatherAndForecast_ForecastHours06_ForecastedTemperature')}}</div>
<div class="condition">{{itemValue('LocalWeatherAndForecast_ForecastHours06_ForecastedWeatherCondition')}}</div>
<img class="icon" height="100%" ng-src="{{itemValue('LocalWeatherAndForecast_ForecastHours06_Icon')}}" src="{{itemValue('LocalWeatherAndForecast_ForecastHours06_Icon')}}"></img>
</div>
</div>