display small crypto amounts with more decimals

fixes #23
This commit is contained in:
2021-03-24 21:25:47 +01:00
parent 19cb3a8c02
commit 91c264e9cd
3 changed files with 11 additions and 3 deletions
+4
View File
@@ -6,5 +6,9 @@ register = template.Library()
def formatcurrency(value):
if value > 100:
return "%0.0f" % (value,)
if value < 0.01:
return "%0.4f" % (value,)
if value < 0.1:
return "%0.3f" % (value,)
return "%0.2f" % (value,)