afadil / wealthfolio

A Beautiful Private and Secure Desktop Investment Tracking Application
https://wealthfolio.app
GNU Affero General Public License v3.0
4.39k stars 228 forks source link

Fix/nan income sources if income is empty #57

Closed alexanderameye closed 2 months ago

alexanderameye commented 2 months ago

When totalIncome is 0, then the percentages show up as NaN. This sets the percentages to 0 if they could not be calculated.

before

image

after

image

Could alternatively do something like this, I see this happens in other places in the code base.

image
alexanderameye commented 2 months ago

Put changes in https://github.com/afadil/wealthfolio/pull/58