From c83690911af9326784d81e49e2b55de9688c1e9b Mon Sep 17 00:00:00 2001 From: Anton Bobov Date: Mon, 20 Sep 2021 22:02:29 +0500 Subject: Ledger price only if not empty. --- ledger-price-db-update.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ledger-price-db-update.py b/ledger-price-db-update.py index 1ab1d4f..eed54bc 100755 --- a/ledger-price-db-update.py +++ b/ledger-price-db-update.py @@ -49,7 +49,8 @@ def print_price(symbol, price, base, date=datetime.datetime.now()): date_str = date.strftime('%Y/%m/%d %H:%M:%S') if ' ' in symbol: symbol = '"' + symbol + '"' - print(('P %s %s %f %s' % (date_str, symbol, price, base))) + if price: + print(('P %s %s %f %s' % (date_str, symbol, price, base))) def exchange_rates(): -- cgit v1.2.3