Fix leaderboard formatting

This commit is contained in:
hodasemi 2023-04-20 09:10:29 +02:00
parent d87ed8c0c9
commit 889b2f212c

View file

@ -218,7 +218,7 @@ impl LeaderBoardEntry {
if best_lap > 60.0 {
let (full_minutes, remainder) = Self::split_minute(best_lap);
format!("{:.0}:{:.3}", full_minutes, remainder)
format!("{:.0}:{:06.3}", full_minutes, remainder)
} else {
format!("{:.3}", best_lap)
}
@ -307,5 +307,7 @@ mod test {
let behind_leader = LeaderBoardEntry::calculate_behind_leader(BehindLeader::Time(85.42));
let behind_next = LeaderBoardEntry::calculate_behind_next(150.213423);
let best_lap = LeaderBoardEntry::calculuate_best_lap(97.23436);
let t = LeaderBoardEntry::calculuate_best_lap(65.23436);
}
}