Page 1 of 1
average of the daily max/min temperatures for a given month
Posted: Wed Jan 12, 2022 5:09 am
by baobab
Hello,
Using the template function, is there a way to get the average of the daily maximum or minimum temperatures for a given month? I've looked through the template documentation but cannot find any reference to a way of doing this. Ultimately, i could pull the high of each day and use that to come up with an average but before going there, I'm hoping there is a simpler ay.
Thanks,
Baobab
Re: average of the daily max/min temperatures for a given month
Posted: Thu Jan 13, 2022 12:15 am
by admin
Meteobridge provides average of all temp data of a month but not averages for daily min/max temps.
Re: average of the daily max/min temperatures for a given month
Posted: Thu Jan 13, 2022 7:12 am
by baobab
OK. Thanks for the reply.
Here is one (not pretty) way of solving it using a bit of javascript in case anyone else is looking for a solution.
Baobab
Code: Select all
<td id="jan21">
<script>
function january21() {
return Math.round(([th0temp-max@20210101] + [th0temp-max@20210102] + [th0temp-max@20210103] + [th0temp-max@20210104] + [th0temp-max@20210105] +
[th0temp-max@20210106] + [th0temp-max@20210107] + [th0temp-max@20210108] + [th0temp-max@20210109] + [th0temp-max@20210110] +
[th0temp-max@20210111] + [th0temp-max@202101012] + [th0temp-max@20210113] + [th0temp-max@20210114] + [th0temp-max@20210115] +
[th0temp-max@20210116] + [th0temp-max@20210117] + [th0temp-max@20210119] + [th0temp-max@20210120] +[th0temp-max@20210121] +
[th0temp-max@20210122] + [th0temp-max@20210123] + [th0temp-max@20210124] + [th0temp-max@20210125] +[th0temp-max@20210126] +
[th0temp-max@20210127] + [th0temp-max@20210128] + [th0temp-max@20210129] + [th0temp-max@20210130] +[th0temp-max@20210131]) / 30 *10) /10;
}
document.getElementById("jan21").innerHTML = january21();
</script>
</td>