Page 1 of 1

Template with weather trends for pas 24 hours

Posted: Wed Dec 30, 2009 3:59 pm
by WS Grave
Hey guys, I've made a template for a table with the weather for the past 24 hours. See code below. The wind is shown in knots. Does anyone know how to change that to km/h ?

Visit my website and click in the menu on "Verleden weer". See the table at the bottom.

Image

/edit:
The code messed up the screen.
Now you can download the template.

Re:Table with weather trends - how to convert knots to km/h?

Posted: Wed Dec 30, 2009 4:06 pm
by WS Grave
You can download the txt-file and rename it to trend.html and put it in the graph direcotry of Meteohub. [file name=trend.txt size=10376]http://www.meteohub.de/joomla/images/fb ... /trend.txt[/file]

Re:Template with weather trends for pas 24 hours

Posted: Wed Dec 30, 2009 5:23 pm
by skyewright
WS Grave wrote:The wind is shown in knots. Does anyone know how to change that to km/h ?
Using _kmh in place of _kn doesn't seem to work with these variables (maybe because they were designed with WDL support in mind) but you can do use the template maths functions to apply a multiplier, e.g:

{math* [seqhour1_wind0_gustspeed_kn@1] 1.852}

Re:Template with weather trends for pas 24 hours

Posted: Wed Dec 30, 2009 7:24 pm
by WS Grave
That works great Sky :)
Do you have a way to translate the wind direction degrees to N-W-S-E ?

/edit:
Attached file is with km/h [file name=trend-18820097b1e6d278542810e643cba4e0.txt size=10585]http://www.meteohub.de/joomla/images/fb ... cba4e0.txt[/file]

Re:Template with weather trends for pas 24 hours

Posted: Thu Dec 31, 2009 7:49 pm
by skyewright
WS Grave wrote:Do you have a way to translate the wind direction degrees to N-W-S-E ?
Sorry, I don't have a neat trick for that.

Probably a case for a bit of javascript (or php if you use php)?

Re:Template with weather trends for pas 24 hours

Posted: Thu Dec 31, 2009 9:55 pm
by wfpost
skyewright wrote:
WS Grave wrote:Do you have a way to translate the wind direction degrees to N-W-S-E ?
Sorry, I don't have a neat trick for that.

Probably a case for a bit of javascript (or php if you use php)?
well, always, but I would be happy if Boris could implement additional IF..THEN operators with the already existing logic of meteohub;)