Bug 430535

Summary: % increase calculation in dashboard account widgets
Product: [Applications] skrooge Reporter: manuel.klemenz
Component: generalAssignee: Stephane MANKOWSKI <stephane>
Status: CLOSED FIXED    
Severity: normal CC: kde, sdkfz262, stephane
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: 25.1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: cropped screenshot

Description manuel.klemenz 2020-12-18 10:29:47 UTC
Created attachment 134177 [details]
cropped screenshot

SUMMARY
When starting a new (bank) account with initial balance = 0.00, and entering a few operations, the percent of change calculation in dashboard widgets shows an insane long number (probably some kind of max of data type, or so). 

STEPS TO REPRODUCE
1. create a new account, initial balance = 0.00
2. add some operations
3. check the operations
4. open the default dashboard

OBSERVED RESULT
The "accounts (full)" and "banks (full)" widgets show an insane number for the first month of percent increase. (+1,000,000,000,000,000,052,504,760,255,204,420,248,704,468,581,108,159,154,915,854,115,511,802,457,988,908,195,786,371,375,080,447,864,043,704,443,832,883,878,176,942,523,235,360,430,575,644,792,184,786,706,982,848,387,200,926,575,803,737,830,233,794,788,090,059,368,953,234,970,799,945,081,119,038,967,640,880,074,652,742,780,142,494,579,258,788,820,056,842,838,115,669,472,196,386,865,459,400,540,160.00 %)

EXPECTED RESULT
not sure, maybe no percentage calculation for the first month when initial balance is zero? I guess anything other than this huge number taking a lot of space...

SOFTWARE/OS VERSIONS
Skrooge: 2.24.0
Linux/KDE Plasma: Gentoo/Plasma 5.20.4
(available in About System)
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.77.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Stephane MANKOWSKI 2020-12-20 15:15:30 UTC
Git commit 61df99104896078782309e4876dbe0e12b92e0c2 by Stephane MANKOWSKI.
Committed on 20/12/2020 at 15:14.
Pushed by smankowski into branch 'master'.

% increase calculation in dashboard account widgets

M  +1    -1    skgbasemodeler/skgdocument.cpp

https://invent.kde.org/office/skrooge/commit/61df99104896078782309e4876dbe0e12b92e0c2
Comment 2 manuel.klemenz 2020-12-20 16:47:56 UTC
The patch works like a charm! Thanks a lot for the quick response.
Comment 3 Stephane MANKOWSKI 2020-12-27 19:34:51 UTC
*** Bug 430863 has been marked as a duplicate of this bug. ***
Comment 4 Stephane MANKOWSKI 2021-04-01 19:32:28 UTC
*** Bug 435203 has been marked as a duplicate of this bug. ***