Add list-pairs and list-markets subcommands

This commit is contained in:
hroff-1902
2019-10-13 13:12:20 +03:00
parent 31389b38f1
commit 7cf7982565
5 changed files with 108 additions and 2 deletions

View File

@@ -121,3 +121,7 @@ def round_dict(d, n):
Rounds float values in the dict to n digits after the decimal point.
"""
return {k: (round(v, n) if isinstance(v, float) else v) for k, v in d.items()}
def plural(num, singular: str, plural: str = None) -> str:
return singular if (num == 1 or num == -1) else plural or singular + 's'