diff --git a/oscar/Graphs/gYAxis.cpp b/oscar/Graphs/gYAxis.cpp index d36e7cb7..fd3e97ff 100644 --- a/oscar/Graphs/gYAxis.cpp +++ b/oscar/Graphs/gYAxis.cpp @@ -327,6 +327,7 @@ bool gYAxis::mouseDoubleClickEvent(QMouseEvent *event, gGraph *graph) const QString gYAxisTime::Format(EventDataType v, int dp) { + // it seems that v is the total duration of the sleep from 12 noon int h = int(v) % 24; int m = int(v * 60) % 60; int s = int(v * 3600) % 60; @@ -337,9 +338,9 @@ const QString gYAxisTime::Format(EventDataType v, int dp) h >= 12 ? pm[0] = 'a' : pm[0] = 'p'; h %= 12; - if (h == 0) { h = 12; } } else { + h < 12 ? h+=12 : h-=12; pm[0] = 0; }