1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-01-02 21:40:30 +00:00

Possible fix for #3230

This commit is contained in:
Ozzie Isaacs 2024-11-20 18:08:25 +01:00
parent 6cb1449ff3
commit 2bfbbfd4ba

View File

@ -111,7 +111,7 @@ def yesno(value, yes, no):
@jinjia.app_template_filter('formatfloat') @jinjia.app_template_filter('formatfloat')
def formatfloat(value, decimals=1): def formatfloat(value, decimals=1):
if not value: if not value or (isinstance(value, str) and not value.is_numeric()):
return value return value
formated_value = ('{0:.' + str(decimals) + 'f}').format(value) formated_value = ('{0:.' + str(decimals) + 'f}').format(value)
if formated_value.endswith('.' + "0" * decimals): if formated_value.endswith('.' + "0" * decimals):