BUG:294268
Details
- Reviewers
- None
- Group Reviewers
KMyMoney - Commits
- R261:b5f71bc3677e: Use price precision setting on investment prices report
Diff Detail
- Repository
- R261 KMyMoney
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
kmymoney/reports/pivottable.h | ||
---|---|---|
164 | Hi Lukasz, I think here it is better to add an overload: QString coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol = QString()) const { return coloredAmount(amount, currencySymbol, KMyMoneyGlobalSettings::pricePrecision()); } and change this function to: QString coloredAmount(const MyMoneyMoney& amount, const QString& currencySymbol, int prec) const; |
kmymoney/reports/pivottable.h | ||
---|---|---|
164 | Outcome is the same. Why overload? |
kmymoney/reports/pivottable.h | ||
---|---|---|
164 | The only reason is my personal view of style. The set default value is not the real value to use but a code for something different. If a caller uses the function he has to notice that -1 itself is a useless value and thus encodes something else instead. Also someone could have the idea to explicitly set this parameter to -1 which means you cannot change that behavior in future. |
This breaks "Net worth" reports which are no longer displayed using the account's currency precision but use the global price precision instead.
Really? Aren't the amounts displayed with pricePrecision positions, instead of the usual 2 (currency precision) positions?
Yes they are displayed with pricePrecision, but "This breaks "Net worth" reports which are no longer displayed" is false. Usual for Kuwaiti Dinar is not 2 but 3 (currency precision) positions.
Yeah I knew that, so what I was trying to say that it breaks the report for most currencies with a precision of 2. Fixing the report for Kuwaiti Dinar and all other currencies for which the hardcoded value just worked is another issue which should be done.