mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-20 11:48:30 -06:00
Merge branch 'bugfix/python_examples' of https://github.com/rgreid/gnucash into maint
This commit is contained in:
commit
b8356cf56e
@ -38,7 +38,7 @@ value = latest.get_value()
|
||||
pl = pdb.get_prices(arm,gbp)
|
||||
for pr in pl:
|
||||
source = pr.get_source()
|
||||
time = pr.get_time()
|
||||
time = pr.get_time64()
|
||||
v=pr.get_value()
|
||||
price = float(v.num)/v.denom
|
||||
print(time, source, price)
|
||||
|
@ -79,7 +79,7 @@ for namespace in namespaces:
|
||||
for pr in pl:
|
||||
|
||||
source = pr.get_source()
|
||||
time = pr.get_time()
|
||||
time = pr.get_time64()
|
||||
v=pr.get_value()
|
||||
price = float(v.num)/v.denom
|
||||
|
||||
|
@ -78,7 +78,7 @@ for i in range(0,len(stock_date)):
|
||||
p_new = pl0.clone(book)
|
||||
p_new = gnucash.GncPrice(instance=p_new)
|
||||
print('Adding',i,stock_date[i],stock_price[i])
|
||||
p_new.set_time(stock_date[i])
|
||||
p_new.set_time64(stock_date[i])
|
||||
v = p_new.get_value()
|
||||
v.num = int(Fraction.from_float(stock_price[i]).limit_denominator(100000).numerator)
|
||||
v.denom = int(Fraction.from_float(stock_price[i]).limit_denominator(100000).denominator)
|
||||
|
Loading…
Reference in New Issue
Block a user