1
0
Fork 0

Stopwatch: improve number formatting

This commit is contained in:
Peetz0r 2021-04-17 23:47:02 +02:00
parent 77470e73f9
commit 7caeecc09b

View file

@ -145,10 +145,10 @@ bool StopWatch::Refresh() {
if (lapPressed == true) { if (lapPressed == true) {
if (lapBuffer[1]) { if (lapBuffer[1]) {
lv_label_set_text_fmt(lapOneText, "#%d %d:%d:%d", (lapNr - 1), lapBuffer[1]->mins, lapBuffer[1]->secs, lapBuffer[1]->msecs); lv_label_set_text_fmt(lapOneText, "#2%d %2d:%02d.%02d", (lapNr - 1), lapBuffer[1]->mins, lapBuffer[1]->secs, lapBuffer[1]->msecs);
} }
if (lapBuffer[0]) { if (lapBuffer[0]) {
lv_label_set_text_fmt(lapTwoText, "#%d %d:%d:%d", lapNr, lapBuffer[0]->mins, lapBuffer[0]->secs, lapBuffer[0]->msecs); lv_label_set_text_fmt(lapTwoText, "#2%d %2d:%02d.%02d", lapNr, lapBuffer[0]->mins, lapBuffer[0]->secs, lapBuffer[0]->msecs);
} }
// Reset the bool to avoid setting the text in each cycle until there is a change // Reset the bool to avoid setting the text in each cycle until there is a change
lapPressed = false; lapPressed = false;