Better printing
This commit is contained in:
parent
3e8512ae65
commit
e9fc21f404
4
meuro.py
4
meuro.py
@ -89,14 +89,14 @@ def cliInterface():
|
|||||||
eur = float(eurS)
|
eur = float(eurS)
|
||||||
meur = euroToMeuro(eur, date)
|
meur = euroToMeuro(eur, date)
|
||||||
print('Exchange rate for '+date.strftime("%d.%m.%Y at %H:%M")+':')
|
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:
|
elif (m:= reFromMeur.search(arg))!=None:
|
||||||
meurS = m.groups()[0]
|
meurS = m.groups()[0]
|
||||||
date = _extractDate(arg.replace(meurS, '-'))
|
date = _extractDate(arg.replace(meurS, '-'))
|
||||||
meur = float(meurS)
|
meur = float(meurS)
|
||||||
eur = euroToMeuro(meur, date)
|
eur = euroToMeuro(meur, date)
|
||||||
print('Exchange rate for '+date.strftime("%d.%m.%Y at %H:%M")+':')
|
print('Exchange rate for '+date.strftime("%d.%m.%Y at %H:%M")+':')
|
||||||
print(str(meur)+'µ = '+str(eur)+'€')
|
print(f'{meur:.2f}µ = {eur:.2f}€')
|
||||||
else:
|
else:
|
||||||
print('[!] Unable to parse input')
|
print('[!] Unable to parse input')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user