Add US unit support for weather observations and forecasts
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful

This commit is contained in:
2026-03-19 22:36:15 -05:00
parent 6e8adcc9cc
commit 26a52f8c44
5 changed files with 460 additions and 18 deletions

View File

@@ -0,0 +1,19 @@
package core
// Units controls response-unit output formatting.
type Units string
const (
UnitsMetric Units = "metric"
UnitsUS Units = "us"
)
const (
celsiusToFahrenheitScale = 9.0 / 5.0
celsiusToFahrenheitOffset = 32.0
kmhToMphFactor = 0.621371192237334
metersToMilesFactor = 0.000621371192237334
metersToFeetFactor = 3.280839895013123
paToInHgFactor = 0.000295299830714045
mmToInchesFactor = 0.03937007874015748
)