1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-07 16:02:51 +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,3 +1,4 @@
#include <QLocale>
#include "data/data.h"
#include "powergraphitem.h"
#include "powergraph.h"
@ -16,9 +17,11 @@ PowerGraph::PowerGraph(QWidget *parent) : GraphTab(parent)
void PowerGraph::setInfo()
{
if (_showTracks) {
GraphView::addInfo(tr("Average"), QString::number(avg() * yScale()
QLocale l(QLocale::system());
GraphView::addInfo(tr("Average"), l.toString(avg() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
GraphView::addInfo(tr("Maximum"), QString::number(max() * yScale()
GraphView::addInfo(tr("Maximum"), l.toString(max() * yScale()
+ yOffset(), 'f', 1) + UNIT_SPACE + yUnits());
} else
clearInfo();