1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-02 22:09:16 +02:00

Display numbers according to the locale settings

Closes #150
This commit is contained in:
2018-09-09 18:46:43 +02:00
parent 3f4b70ee48
commit 2501f834c8
20 changed files with 119 additions and 63 deletions

View File

@ -1,7 +1,9 @@
#include <QLocale>
#include "tooltip.h"
#include "format.h"
#include "speedgraphitem.h"
SpeedGraphItem::SpeedGraphItem(const Graph &graph, GraphType type,
qreal movingTime, QGraphicsItem *parent) : GraphItem(graph, type, parent)
{
@ -25,10 +27,11 @@ QString SpeedGraphItem::toolTip() const
? avg() * scale : mavg() * scale)), false);
QString pu = (_units == Metric) ? tr("min/km") : (_units == Imperial) ?
tr("min/mi") : tr("min/nmi");
QLocale l(QLocale::system());
tt.insert(tr("Maximum"), QString::number(max() * scale, 'f', 1)
tt.insert(tr("Maximum"), l.toString(max() * scale, 'f', 1)
+ UNIT_SPACE + su);
tt.insert(tr("Average"), QString::number((_timeType == Total)
tt.insert(tr("Average"), l.toString((_timeType == Total)
? avg() * scale : mavg() * scale, 'f', 1) + UNIT_SPACE + su);
tt.insert(tr("Pace"), pace + UNIT_SPACE + pu);