Bug 440745

Summary: Update EUR/BTC price online does not work
Product: [Applications] kmymoney Reporter: Tony <tony>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: REPORTED ---    
Severity: normal CC: tony
Priority: NOR    
Version First Reported In: 5.1.2   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Tony 2021-08-08 15:15:49 UTC
SUMMARY
KMyMoney does not retrieve the correct value of EUR/BTC when updating for a single date (which uses fx-rate.net).

STEPS TO REPRODUCE
1. Select the menu Tools => Update Stock and Currency Prices
2. Select the currency pair EUR > BTC
3. Click the button "Update Selected"

OBSERVED RESULT
Fetching URL https://fx-rate.net/EUR/BTC...
Identifier found: 'EUR/BTC'
Price found: '2.664' (2.664)
Date found: 'Sun Aug 8 2021'
Price for EUR > BTC updated (ID EUR BTC)

EXPECTED RESULT
Fetching URL https://fx-rate.net/EUR/BTC...
Identifier found: 'EUR/BTC'
Price found: '2.664e-5' (0.00002664)
Date found: 'Sun Aug 8 2021'
Price for EUR > BTC updated (ID EUR BTC)

SOFTWARE/OS VERSIONS
Windows: Windows 10 Home 20H2

ADDITIONAL INFORMATION
I am using KMyMoney version 5.1.2-772e77894.

For EUR/BTC, fx-rate.net returns a number in scientific notation. The regex configuration that extracts this number is ([,\d+\.]+). I made a simple change to ([,\d+\.e-]+), then re-ran the STEPS TO REPRODUCE and KMyMoney displayed "Price found: '2.664e-5' (2.664e-05)" in the output. However, KMyMoney did not use this value to update the price history of the currency.

Updating a range of prices also does not work (which uses stooq.com). I will submit a formal bug report if you want; however, it's easy to reproduce it.

Fixing these bugs will allow the tracking of cryptocurrencies in KMyMoney and would be a very useful capability.