afadil / wealthfolio

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

Activities - Change quantity and price to decimal #41

Closed February30th closed 1 month ago

February30th commented 2 months ago

The activity quantity and price are coded a f64, this creates an issue with fractional shares.

afadil commented 2 months ago

what is the issue with f64? You can log decimal values for quantity and price.

February30th commented 2 months ago

Example csv to reproduce decimal issues

date,symbol,quantity,activityType,unitPrice,currency,fee
2024-07-05 10:00:43.343,BMW3.DE,0.0481040000,BUY,83.15,EUR,0
2024-07-16 08:20:07.675,BMW3.DE,0.1925370000,BUY,83.1,EUR,0
2024-07-22 10:56:01.155,BMW3.DE,0.2406410000,SELL,84.55,EUR,0
February30th commented 2 months ago

Also noticed that the sql fields are created as NUMERIC instead of a DECIMAL

shivasurya commented 2 months ago

Yeah it would be really good to support decimal to accomodate fractional shares

afadil commented 2 months ago

The already support franctional shares. I have no problem importing the CSV example you provided: Screenshot 2024-09-07 at 5 58 44 PM

February30th commented 2 months ago

Check the holdings tab.

araishikeiwai commented 2 months ago

I also have this issue where one of my holdings (fully sold) is still listed as having 4.20692347383774e-16 units left

afadil commented 1 month ago

Done in v1.0.18