From b72a2839061c4ac3d54ecfccf65559c4bc34a4ac Mon Sep 17 00:00:00 2001 From: Petri Hienonen Date: Wed, 11 Feb 2026 16:31:13 +0200 Subject: Update the calculations --- converter.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'converter.go') diff --git a/converter.go b/converter.go index e843f35..efaed5b 100644 --- a/converter.go +++ b/converter.go @@ -83,9 +83,9 @@ func (fd *ForecastData) convertToCurrent(index int, timestamp int64, loc *time.L current.DewPoint = val } - // Extract wind speed (convert m/s to km/h) + // Extract wind speed (FMI provides m/s) if val, err := fd.getFloatValue(index, "WindSpeedMS"); err == nil && !math.IsNaN(val) { - current.WindSpeed = val * 3.6 + current.WindSpeed = val } // Extract wind direction @@ -93,9 +93,9 @@ func (fd *ForecastData) convertToCurrent(index int, timestamp int64, loc *time.L current.WindDeg = int(math.Round(val)) } - // Extract wind gust (convert m/s to km/h) + // Extract wind gust (m/s) if val, err := fd.getFloatValue(index, "WindGust"); err == nil && !math.IsNaN(val) { - current.WindGust = val * 3.6 + current.WindGust = val } // Extract cloud cover @@ -109,7 +109,7 @@ func (fd *ForecastData) convertToCurrent(index int, timestamp int64, loc *time.L } // Calculate feels-like temperature - current.FeelsLike = CalculateFeelsLike(current.Temp, float64(current.Humidity), current.WindSpeed) + current.FeelsLike = CalculateFeelsLike(current.Temp, float64(current.Humidity), current.WindSpeed*3.6) // Handle precipitation (convert from mm/h) if val, err := fd.getFloatValue(index, "PrecipitationRate"); err == nil && !math.IsNaN(val) && val > 0 { -- cgit v1.3-1-g0d28