Skip to content

Commit

Permalink
fix: fix returned distance
Browse files Browse the repository at this point in the history
  • Loading branch information
ermasavior committed Nov 21, 2024
1 parent 2f033ac commit ef0e1ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/rides/model/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func (r RideData) ToResponse() RideDataResponse {
}
var distance string
if r.Distance != nil {
distance = fmt.Sprintf("%.2f", *r.Distance)
distance = fmt.Sprintf("%.6f", *r.Distance)
}
var fare string
if r.Fare != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/rides/model/response_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestRideData_ToResponse(t *testing.T) {
Longitude: 2,
Latitude: 2,
},
Distance: "10.00",
Distance: "10.000000",
Fare: "10000.00",
FinalPrice: "9000.00",
Status: StatusRideCancelled,
Expand Down

0 comments on commit ef0e1ce

Please sign in to comment.