add partial share ownership support (float)... and penny rounding errors.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
61074bfd80
commit
3c274c614b
@ -9,8 +9,8 @@ import (
|
||||
)
|
||||
|
||||
type security struct {
|
||||
Symbol string `json:"symbol"`
|
||||
Quantity int `json:"quantity"`
|
||||
Symbol string `json:"symbol"`
|
||||
Quantity float64 `json:"quantity"`
|
||||
}
|
||||
|
||||
type account struct {
|
||||
@ -63,7 +63,7 @@ func (p *Provider) GetBalances() ([]int, []string, error) {
|
||||
if err != nil {
|
||||
return balances, ynabAccountIDs, fmt.Errorf("failed to get quote for security with symbol '%s': %v", p.data.Accounts[i].Securities[j].Symbol, err)
|
||||
}
|
||||
balance += price * p.data.Accounts[i].Securities[j].Quantity
|
||||
balance += int(float64(price) * p.data.Accounts[i].Securities[j].Quantity)
|
||||
}
|
||||
balances = append(balances, balance)
|
||||
ynabAccountIDs = append(ynabAccountIDs, p.data.Accounts[i].YnabAccountID)
|
||||
|
Loading…
x
Reference in New Issue
Block a user