Added temp formatting to '/stats' and added documentation and CI

This commit is contained in:
2025-06-19 17:22:44 +02:00
parent ca4b75af7a
commit 0f487e3f93
9 changed files with 1102 additions and 17 deletions

View File

@@ -46,13 +46,13 @@ func GetStatistics(cityName string, statDB *types.StatDB) (types.StatResult, err
// Compute statistics
return types.StatResult{
Min: slices.Min(temps),
Max: slices.Max(temps),
Min: strconv.FormatFloat(slices.Min(temps), 'f', -1, 64),
Max: strconv.FormatFloat(slices.Max(temps), 'f', -1, 64),
Count: len(stats),
Mean: statistics.Mean(temps),
StdDev: statistics.StdDev(temps),
Median: statistics.Median(temps),
Mode: statistics.Mode(temps),
Mean: strconv.FormatFloat(statistics.Mean(temps), 'f', -1, 64),
StdDev: strconv.FormatFloat(statistics.StdDev(temps), 'f', -1, 64),
Median: strconv.FormatFloat(statistics.Median(temps), 'f', -1, 64),
Mode: strconv.FormatFloat(statistics.Mode(temps), 'f', -1, 64),
Anomaly: &anomalies,
}, nil
}