Add US unit support for weather observations and forecasts
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
All checks were successful
ci/woodpecker/push/build-image Pipeline was successful
This commit is contained in:
19
internal/core/constants.go
Normal file
19
internal/core/constants.go
Normal 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
|
||||
)
|
||||
Reference in New Issue
Block a user