From e9fc21f404eeef0f17f07341adfe8ed499d39072 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Sat, 30 Oct 2021 11:50:07 +0200 Subject: [PATCH] Better printing --- meuro.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meuro.py b/meuro.py index 40f1b54..e37f8ad 100755 --- a/meuro.py +++ b/meuro.py @@ -89,14 +89,14 @@ def cliInterface(): eur = float(eurS) meur = euroToMeuro(eur, date) print('Exchange rate for '+date.strftime("%d.%m.%Y at %H:%M")+':') - print(str(eur)+'€ = '+str(meur)+'µ') + print(f'{eur:.2f}€ = {meur:.2f}µ') elif (m:= reFromMeur.search(arg))!=None: meurS = m.groups()[0] date = _extractDate(arg.replace(meurS, '-')) meur = float(meurS) eur = euroToMeuro(meur, date) print('Exchange rate for '+date.strftime("%d.%m.%Y at %H:%M")+':') - print(str(meur)+'µ = '+str(eur)+'€') + print(f'{meur:.2f}µ = {eur:.2f}€') else: print('[!] Unable to parse input')