From 8f7c23816da65bf8dd348ce5412bf0411df65366 Mon Sep 17 00:00:00 2001 From: Charles Haley Date: Sat, 10 May 2014 12:13:43 +0200 Subject: [PATCH] First error in first_matching_compare documentation --- manual/template_lang.rst | 2 +- src/calibre/utils/formatter_functions.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/template_lang.rst b/manual/template_lang.rst index 0c2d445c5d..998c329238 100644 --- a/manual/template_lang.rst +++ b/manual/template_lang.rst @@ -254,7 +254,7 @@ The following functions are available in addition to those described in single-f ``first_matching_cmp(10,5,"small",10,"middle",15,"large","giant")`` - returns "middle". The same example with a first value of 16 returns "giant". + returns "large". The same example with a first value of 16 returns "giant". * ``first_non_empty(value, value, ...)`` -- returns the first value that is not empty. If all values are empty, then the empty value is returned. You can have as many values as you want. * ``format_date(x, date_format)`` -- format_date(val, format_string) -- format the value, which must be a date field, using the format_string, returning a string. The formatting codes are:: diff --git a/src/calibre/utils/formatter_functions.py b/src/calibre/utils/formatter_functions.py index 3ddecc4169..e3eac0255e 100644 --- a/src/calibre/utils/formatter_functions.py +++ b/src/calibre/utils/formatter_functions.py @@ -187,7 +187,7 @@ class BuiltinFirstMatchingCmp(BuiltinFormatterFunction): 'the first comparison that succeeds. Returns else_result ' 'if no comparison succeeds. Example: ' 'first_matching_cmp(10,5,"small",10,"middle",15,"large","giant") ' - 'returns "middle". The same example with a first value of 16 returns "giant".') + 'returns "large". The same example with a first value of 16 returns "giant".') def evaluate(self, formatter, kwargs, mi, locals, *args): if (len(args) % 2) != 0: