[kmymoney4] [Bug 382427] Incorrect formatting of number display of point label in graph reports

Ralf Habacker bugzilla_noreply at kde.org
Mon Jul 17 14:02:37 UTC 2017


https://bugs.kde.org/show_bug.cgi?id=382427

--- Comment #2 from Ralf Habacker <ralf.habacker at freenet.de> ---
The problem is located inside class void KDChart::AbstractDiagram::Private

methods

 void paintDataValueText( const AbstractDiagram* diag,
                                 QPainter* painter,
                                 const QModelIndex& index,
                                 const QPointF& pos,
                                 double value,
                                 bool justCalculateRect=false,
                                 QRectF* cumulatedBoundingRect=0 )

and  

QString roundValues( double value,
                     const int decimalPos,
                     const int decimalDigits) const;


They simply use QString::number(value) with default conversation settings which
are QString::number(value, 'g', 6). A number of 18000000 is returned as
"1.80e+7".

Also in KReportChartView::drawPivotChart() there is used 

 
dataValueAttr.setDecimalDigits(MyMoneyMoney::denomToPrec(MyMoneyFile::instance()->baseCurrency().smallestAccountFraction()));

which limits the number of digits to 2 which results into 1.80 for the
mentioned value 18000000. Another example is 180.000 which is displayed also as
1.80.

The fix is to refactor the mentioned methods.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the KMyMoney-devel mailing list