diff options
| author | Anton Bobov <abobov@gmail.com> | 2021-09-20 22:02:29 +0500 |
|---|---|---|
| committer | Anton Bobov <abobov@gmail.com> | 2021-09-20 22:02:29 +0500 |
| commit | c83690911af9326784d81e49e2b55de9688c1e9b (patch) | |
| tree | b12a0bfe031501cf0c30b7bf5d45039644b13ecd | |
| parent | f563df749c7638ac3c7d82ae6ab48895581c10b9 (diff) | |
Ledger price only if not empty.
| -rwxr-xr-x | ledger-price-db-update.py | 3 |
1 files changed, 2 insertions, 1 deletions
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(): |
