output percentage
This commit is contained in:
12
app.cpp
12
app.cpp
@@ -248,20 +248,22 @@ int gymTrackerStatus(Arena *arena, list<string> args) {
|
|||||||
if (workPerExerciseByDay.data[j] != 0.0f) {
|
if (workPerExerciseByDay.data[j] != 0.0f) {
|
||||||
const char *fmtString;
|
const char *fmtString;
|
||||||
real32 improvement = 0;
|
real32 improvement = 0;
|
||||||
|
real32 workToday = workPerExerciseByDay.data[j];
|
||||||
|
real32 workLastTime = workPerExerciseByPrevDay.data[j];
|
||||||
if (workPerExerciseByPrevDay.data[j] == 0) {
|
if (workPerExerciseByPrevDay.data[j] == 0) {
|
||||||
fmtString = COLOR_TEXT("%S", ANSI_fg_cyan) ": %.2fkg in %.2fmin\n";
|
fmtString = COLOR_TEXT("%S", ANSI_fg_cyan) ": %.2fkg in %.2fmin\n";
|
||||||
} else {
|
} else {
|
||||||
improvement = workPerExerciseByDay.data[j] - workPerExerciseByPrevDay.data[j];
|
improvement = workToday - workLastTime;
|
||||||
if (improvement > 0) {
|
if (improvement > 0) {
|
||||||
fmtString = COLOR_TEXT("%S", ANSI_fg_cyan) ": %.2fkg in %.2fmin " COLOR_TEXT("+%.2fkg\n", ANSI_fg_green);
|
fmtString = COLOR_TEXT("%S", ANSI_fg_cyan) ": %.2fkg in %.2fmin " COLOR_TEXT("+%.2fkg (+%.2f%%)\n", ANSI_fg_green);
|
||||||
} else {
|
} else {
|
||||||
fmtString = COLOR_TEXT("%S", ANSI_fg_cyan) ": %.2fkg in %.2fmin " COLOR_TEXT("%.2fkg\n", ANSI_fg_red);
|
fmtString = COLOR_TEXT("%S", ANSI_fg_cyan) ": %.2fkg in %.2fmin " COLOR_TEXT("%.2fkg (%.2f%%)\n", ANSI_fg_red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log(fmtString, nameByExercise.data[j], workPerExerciseByDay.data[j], (real32)restPerExerciseByDay.data[j] / 60.0f, improvement);
|
log(fmtString, nameByExercise.data[j], workToday, (real32)restPerExerciseByDay.data[j] / 60.0f, improvement, improvement / workLastTime * 100);
|
||||||
|
|
||||||
workPerExerciseByPrevDay.data[j] = workPerExerciseByDay.data[j];
|
workPerExerciseByPrevDay.data[j] = workToday;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
zeroListFull(&workPerExerciseByDay);
|
zeroListFull(&workPerExerciseByDay);
|
||||||
|
|||||||
Reference in New Issue
Block a user