mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Robustness fix for the human_readable formatter function -- make it accept a floating point number.
This commit is contained in:
parent
96337de289
commit
5d4ee0e9c5
@ -624,7 +624,7 @@ class BuiltinHumanReadable(BuiltinFormatterFunction):
|
||||
|
||||
def evaluate(self, formatter, kwargs, mi, locals, val):
|
||||
try:
|
||||
return human_readable(long(val))
|
||||
return human_readable(round(float(val)))
|
||||
except:
|
||||
return ''
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user