beanieboi / moneymoney-estateguru

MoneyMoney App Extension for Estateguru
MIT License
2 stars 3 forks source link

Parsing for values > 999 EUR wrong #4

Open siedi opened 5 years ago

siedi commented 5 years ago

Having more than 1.000 EUR in the account, the parsing mixes the thousand separators '.' with the decimal separator, thus the parsed number will become e.g. 9.000.00 instead of 9,000.00 or 9000.00. The application throws an error:

estateguru.lua: expected number for 'securities.purchasePrice', securities name 'Account Summary'

Unfortunately, I can't fix it myself, I have the app from the app store and it doesn't allow extension without a signature

lr1980 commented 5 years ago

try this file (I cannot test it => my account is not over 1000€ ;) ): https://github.com/lr1980/moneymoney-estateguru/blob/dotconversion/estateguru.lua

you need the test/beta version to use it...

siedi commented 5 years ago

Unfortunately, I can't test the changes without having a signed extension. I'm running the version from the App Store and this doesn't allow unsigned extensions (not sure why the developer decided so).

lr1980 commented 5 years ago

I think you can remove the app and install the download version...

siedi commented 5 years ago

ok, finally got it working, with your patch @lr1980, using the English format, I added another gsub and removed the comma, resulting in something like this:

account_value = content:xpath('/html/body/section/div/div/div/div[2]/section[1]/div/div/div[3]/div/div[2]/ul/li[1]/div[1]/span[2]'):text()
account_value = string.gsub(string.gsub(account_value, "€", ""), ",", "")

invested = content:xpath('//*[@id="collapse0"]/ul/li[1]/div/span[2]'):text()
invested = string.gsub(string.gsub(invested, "€", ""), ",", "")

May I ask you to create the PR? I'm too lazy :-)