From 8d4ddb94f6a41bd6a6957a2e11b86c6ed5f1ae7a Mon Sep 17 00:00:00 2001 From: Alejandro Martinez Date: Sat, 1 Aug 2015 17:51:08 -0300 Subject: [PATCH] Minor tweak in Histogram round numbers for labels Truncation is rather odd, specially for percentages --- src/PowerHist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PowerHist.cpp b/src/PowerHist.cpp index 2c3334949..7345ea0f0 100644 --- a/src/PowerHist.cpp +++ b/src/PowerHist.cpp @@ -648,7 +648,7 @@ PowerHist::recalcCompare() // now add a label above the bar QwtPlotMarker *label = new QwtPlotMarker(); - QwtText text(QString("%1%2").arg(int(yval)).arg(absolutetime ? "" : "%"), QwtText::PlainText); + QwtText text(QString("%1%2").arg(round(yval)).arg(absolutetime ? "" : "%"), QwtText::PlainText); text.setFont(labelFont); text.setColor(color); label->setLabel(text); @@ -886,7 +886,7 @@ PowerHist::recalc(bool force) // now add a label above the bar QwtPlotMarker *label = new QwtPlotMarker(); - QwtText text(QString("%1%2").arg(int(yval)).arg(absolutetime ? "" : "%"), QwtText::PlainText); + QwtText text(QString("%1%2").arg(round(yval)).arg(absolutetime ? "" : "%"), QwtText::PlainText); text.setFont(labelFont); if (series == RideFile::watts) text.setColor(GColor(CPOWER).darker(200));