From 5d4ee0e9c58a9e17fa6d59f5e8126374ba75c462 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Fri, 30 Sep 2011 09:43:37 +0200 Subject: [PATCH] Robustness fix for the human_readable formatter function -- make it accept a floating point number. --- src/calibre/utils/formatter_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/utils/formatter_functions.py b/src/calibre/utils/formatter_functions.py index 49472d0ca9..3a5a04128e 100644 --- a/src/calibre/utils/formatter_functions.py +++ b/src/calibre/utils/formatter_functions.py @@ -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 ''