Skip to content

Commit

Permalink
fix LonDir returning wrong east/west direction (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
aldas authored Jun 12, 2023
1 parent 502878b commit 0203fa1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ func LatDir(l float64) string {
// LonDir returns the longitude direction symbol
func LonDir(l float64) string {
if l < 0.0 {
return East
return West
}
return West
return East
}

// Float64 is a nullable float64 value
Expand Down
4 changes: 2 additions & 2 deletions types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ func TestLonDir(t *testing.T) {
value float64
expected string
}{
{100.0, "W"},
{-100.0, "E"},
{100.0, "E"},
{-100.0, "W"},
}
for _, tt := range tests {
if s := LonDir(tt.value); s != tt.expected {
Expand Down

0 comments on commit 0203fa1

Please sign in to comment.