feature request - wind in Beaufort

17 views
Skip to first unread message

Bernhard Rohrer

unread,
Aug 24, 2015, 2:40:01 PM8/24/15
to Cinnamon Weather
Hi

I cannot think in anything but wind force in beaufort - would it be possible to add that to the options?

Thanks

/Bernhard

Ichnaton

unread,
Mar 4, 2018, 7:49:16 AM3/4/18
to Cinnamon Weather
Hi Bernhard
I ran into the same problem.   I did write some code although newbie at JS, Cinnamon and everything. I can make the conversion but I'm not getting things working in the applet. Yet.

Maybe there is a saint or smith who knows how to handle.

Bar

 function _kphToBft(wkph) {
    // use a separate function for only this conversion
    // source
    // https://www.windfinder.com/wind/windspeed.htm

    if (!wkph.toString().length ) { return '' ;}
    wkph = Math.round(wkph) 
    if (wkph <= 0 ) { return 0 ;  }
    if (wkph >= 1 && wkph <=  5 )   { return 1 }
    if (wkph >= 6 && wkph <= 11 )   { return 2 }
    if (wkph >= 12 && wkph <= 19 )  { return 3 }
    if (wkph >= 20 && wkph <= 28 )  { return 4 }
    if (wkph >= 29 && wkph <= 38 )  { return 5 }
    if (wkph >= 39 && wkph <= 49 )  { return 6 }
    if (wkph >= 50 && wkph <= 61 )  { return 7 }
    if (wkph >= 62 && wkph <= 74 )  { return 8 }
    if (wkph >= 75 && wkph <= 88 )  { return 9 }
    if (wkph >= 89 && wkph <= 102)  { return 10 }
    if (wkph >= 103 && wkph <= 117) { return 11 }
    if (wkph >= 118 )               { return 12 }
    return ""
  }




Op maandag 24 augustus 2015 20:40:01 UTC+2 schreef Bernhard Rohrer:
Reply all
Reply to author
Forward
0 new messages