Skip to content

Commit

Permalink
fix: remove useless zeros in fp results
Browse files Browse the repository at this point in the history
  • Loading branch information
BrightDV committed Feb 26, 2025
1 parent 30e27b7 commit cd8766e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/api/formula1.dart
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class Formula1 {
Convert().teamsFromFormulaOneApiToErgast(element['teamName']),
time,
fastestLapRank != '0' ? true : false,
fastestLapRank != '0' ? fastestLapTime : "",
fastestLapRank != '0' ? fastestLapTime.replaceAll('00:', "") : "",
"", // data not available
points: element['racePoints'].toString(),
status: element['completionStatusCode'],
Expand Down Expand Up @@ -472,6 +472,10 @@ class Formula1 {
}
time += 's';
}
String classifiedTime = element['classifiedTime'] ?? '';
if (classifiedTime.startsWith('00:')) {
classifiedTime = classifiedTime.replaceFirst('00:', '');
}

driversResults.add(
DriverResult(
Expand All @@ -483,7 +487,7 @@ class Formula1 {
element['driverLastName'] ?? '',
element['driverTLA'],
Convert().teamsFromFormulaOneApiToErgast(element['teamName']),
element['classifiedTime'] ?? '',
classifiedTime.replaceFirst('0000', ''),
false,
"",
time,
Expand Down

0 comments on commit cd8766e

Please sign in to comment.