In webpricequote.cpp there is the following code and comment. if (priceRegExp.indexIn(quotedata) > -1) { gotprice = true; // Deal with european quotes that come back as X.XXX,XX or XX,XXX // // We will make the assumption that ALL prices have a decimal separator. // So "1,000" always means 1.0, not 1000.0. // // Remove all non-digits from the price string except the last one, and // set the last one to a period. QString pricestr = priceRegExp.cap(1); int pos = pricestr.lastIndexOf(QRegExp("\\D")); if (pos > 0) { pricestr[pos] = '.'; pos = pricestr.lastIndexOf(QRegExp("\\D"), pos - 1); } while (pos > 0) { pricestr.remove(pos, 1); pos = pricestr.lastIndexOf(QRegExp("\\D"), pos); } d->m_price = pricestr.toDouble(); kDebug(Private::dbgArea()) << "Price" << pricestr; emit status(i18n("Price found: %1 (%2)", pricestr, d->m_price)); } This causes problems with a quote source I have which doesn't return decimal places if they are zero. e.g. The source returns 1,065.25 and this correctly gets interpreted as 1065.25 but if the source returns 1,065 this is interpreted as 1.065 instead of 1065.00 Could KMyMoney use the locale thousand separator and decimal indicator when interpreting prices from quote sources? Reproducible: Always
Don't know. What about the use case that I have setup my system to use the German locale but import prices from a source using a US/UK locale (so usage of comma and period in a number are reverse)? One idea that just crosses my mind is to have some sort of format option for each price source or specify the thousands separator and decimal delimiter for each of them in the settings.
> In webpricequote.cpp th Assigned to libalkimia, as this support was outsourced to the aforementioned library.
This issue may be related to bug 432770.
Git commit 55a0d05a414850df9a4bf12843e022d61fe42f0d by Ralf Habacker. Committed on 05/03/2024 at 22:25. Pushed by habacker into branch 'master'. Add additional unit test for parsing prices using 'x,yyy' M +5 -0 autotests/alkonlinequoteprivatetest.cpp https://invent.kde.org/office/alkimia/-/commit/55a0d05a414850df9a4bf12843e022d61fe42f0d
(In reply to David Houlden from comment #0) > but if the source returns 1,065 this is interpreted as 1.065 instead > of 1065.00 This is still the case
A possibly relevant merge request was started @ https://invent.kde.org/office/alkimia/-/merge_requests/26
Git commit f4b8e6d3a30260174ddc7a99cdf6d421d057e622 by Ralf Habacker. Committed on 13/03/2024 at 17:00. Pushed by habacker into branch 'master'. Add support to select decimal separator used for parsing prices To support the previous behaviour, an "old" decimal separator has also been added as existing users may rely on it. For existing online source definitions, this variant is automatically used as the default. FIXED-IN:8.2 M +37 -1 autotests/alkonlinequoteprivatetest.cpp M +3 -0 autotests/alkonlinequotesourcetest.cpp M +30 -16 src/alkonlinequote_p.cpp M +1 -1 src/alkonlinequote_p.h M +110 -84 src/alkonlinequotedetails.ui M +13 -1 src/alkonlinequotesource.cpp M +13 -1 src/alkonlinequotesource.h M +18 -1 src/alkonlinequotesource_p.h M +6 -0 src/alkonlinequoteswidget.cpp https://invent.kde.org/office/alkimia/-/commit/f4b8e6d3a30260174ddc7a99cdf6d421d057e622