Forecast humidity

By default the humidity is showed as zero point something (for example: 80 divided by 100, so 0.80). Is there a way to change this to “80 %”?

we would need to add a helper to the code for that and provide a new substitution humidityPercent.

you could do this yourself here: https://github.com/xibosignage/xibo-cms/blob/master/modules/forecastio.module.php#L719

$data->currently->humidityPercent = (isset($data->daily->humidity) ? $data->daily->humidity * 100 : 0);

and here: https://github.com/xibosignage/xibo-cms/blob/master/modules/forecastio.module.php#L736

$data['daily']['data'][$i]['humidityPercent'] = (isset($data['daily']['data'][$i]['humidity'])) ? $data['daily']['data'][$i]['humidity'] * 100 : 0;

Thanks. Then I first have to ask for permission to login to the server :stuck_out_tongue:

1 Like

I have added these codes to the PHP file.

Is this div correct? Because now the humidity is 0.

< div class= “hum” >Humidity: [humidityPercent]< /div >

Sorry, its not correct :frowning:

$data->currently->humidityPercent = (isset($data->currently->humidity) ? $data->currently->humidity * 100 : 0);

Problem solved :thumbsup:

2 Likes