Swapped ascent/descent from km/mi to m/ft
This commit is contained in:
@ -6,9 +6,9 @@ export const formatTooltipValue = (
|
||||
displayedData: TStatisticsDatasetKeys,
|
||||
value: number,
|
||||
useImperialUnits: boolean,
|
||||
formatWithUnits = true
|
||||
formatWithUnits = true,
|
||||
unitFrom = 'km'
|
||||
): string => {
|
||||
const unitFrom = 'km'
|
||||
const unitTo = useImperialUnits ? units[unitFrom].defaultTarget : unitFrom
|
||||
switch (displayedData) {
|
||||
case 'average_speed':
|
||||
@ -16,10 +16,9 @@ export const formatTooltipValue = (
|
||||
case 'total_duration':
|
||||
return formatDuration(value, formatWithUnits)
|
||||
case 'total_distance':
|
||||
return `${value.toFixed(2)} ${unitTo}`
|
||||
case 'total_ascent':
|
||||
case 'total_descent':
|
||||
return `${(value / 1000).toFixed(2)} ${unitTo}`
|
||||
return `${value.toFixed(2)} ${unitTo}`
|
||||
default:
|
||||
return value.toString()
|
||||
}
|
||||
|
Reference in New Issue
Block a user