Merge branch 'bugfix/python_examples' of https://github.com/rgreid/gnucash into maint

This commit is contained in:
Geert Janssens 2019-01-31 17:23:10 +01:00
commit b8356cf56e
3 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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

View File

@ -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)