Skip to content

Commit

Permalink
fix: Show kilometer based distance
Browse files Browse the repository at this point in the history
  • Loading branch information
devcshort committed Nov 11, 2024
1 parent 84c5231 commit 206af5c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/features/search/components/result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { Link } from '@/shared/components/link';
import {
cn,
distanceBetweenCoordsInMiles,
distanceBetweenCoordsInKm,
getGoogleMapsDestinationUrl,
} from '@/shared/lib/utils';
import { ResultType } from '@/shared/store/results';
Expand Down Expand Up @@ -44,7 +44,7 @@ export function Result({ data }: ResultProps) {

const distance =
data?.location?.coordinates && (coords?.length ?? 0) === 2
? distanceBetweenCoordsInMiles(
? distanceBetweenCoordsInKm(
coords as [number, number],
data.location.coordinates,
)
Expand All @@ -67,7 +67,7 @@ export function Result({ data }: ResultProps) {
{distance != null && distance > 0 && (
<Badge variant="outline" className="flex gap-1">
<Navigation className="size-3" />
{distance.toLocaleString()} {t('search.miles')}
{distance.toFixed(1)} {t('search.miles')}
</Badge>
)}
</div>
Expand Down

0 comments on commit 206af5c

Please sign in to comment.