Skip to content

Commit

Permalink
fix: I was today days old when I learned how to spell Fahrenheit
Browse files Browse the repository at this point in the history
  • Loading branch information
deregtd committed Jul 13, 2024
1 parent 283c084 commit 1b15ce9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions pkg/units/temperature.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
)

// TemperatureUnit is an enum for all temperature unit types
// ENUM(Kelvin, Farenheit, Celsius)
// ENUM(Kelvin, Fahrenheit, Celsius)
//
//go:generate go run github.com/abice/go-enum@latest --noprefix --values
type TemperatureUnit int
Expand Down Expand Up @@ -46,7 +46,7 @@ func (p Temperature) Convert(newUnit TemperatureUnit) Temperature {
switch p.Unit {
case Kelvin:
inKelvin = p.Value
case Farenheit:
case Fahrenheit:
inKelvin = (p.Value + 459.67) * (5.0 / 9.0)
case Celsius:
inKelvin = p.Value + 273.15
Expand All @@ -56,7 +56,7 @@ func (p Temperature) Convert(newUnit TemperatureUnit) Temperature {
switch newUnit {
case Kelvin:
return NewTemperature(newUnit, inKelvin)
case Farenheit:
case Fahrenheit:
return NewTemperature(newUnit, inKelvin*(9.0/5.0)-459.67)
case Celsius:
return NewTemperature(newUnit, inKelvin-273.15)
Expand Down
18 changes: 9 additions & 9 deletions pkg/units/temperature_enum.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b15ce9

Please sign in to comment.