Hi,
I actively monitor volcanic and seismic activities using this skin, I would like to find a way to automatically convert the speed data of thunderstorms into kilometers per hour. I know the formula is: kph=(mph*1,60934) but could not find where to place this change in the file "StormFetch.lua"
It is currently April 23rd, 2024, 7:01 am
Mph to kph
-
- Posts: 126
- Joined: December 31st, 2015, 6:40 pm
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Mph to kph
Change this:
And add this at the bottom:
Code: Select all
if string.match(sItem, sPatternStormWind) then
tWind[i] = string.match(sItem, sPatternStormWind)
windSpeed = tonumber(string.match(tWind[i], '(.-) MPH'))
tWind[i] = math.round((windSpeed * 1.60934))..' KPH'
tMoving[i] = string.match(sItem, sPatternStormMoving)
else
Code: Select all
function math.round(num, idp)
assert(tonumber(num), 'Round expects a number.')
local mult = 10 ^ (idp or 0)
if num >= 0 then
return math.floor(num * mult + 0.5) / mult
else
return math.ceil(num * mult - 0.5) / mult
end
end
You do not have the required permissions to view the files attached to this post.
-
- Posts: 126
- Joined: December 31st, 2015, 6:40 pm
Re: Mph to kph
Thank you Jsmorley, that's exactly what I wanted !