Fixes for new 64-bit time setter/getters

This commit is contained in:
Rob Reid
2019-01-06 22:05:43 +08:00
parent 793fb1a3ed
commit 9be545f5ce
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)