Use the following for the plugboard template.
Code:
program:
# Grab a copy of the series text
s = field('#abbrseries');
# Work out if the series index has a decimal point. If so, format it nn.n, otherwise format it nn
i = field('#abbrseries_index');
index = switch(i, '\.', format_number(i, '{0:04.1f}'), format_number(i, '{0:02d}'));
# Construct the full title containing the series & index
full = strcat(
s,
' ',
index,
' - ',
field('title')
);
# Select the full value computed above if there is something in #abbrseries, otherwise use only the title.
first_non_empty(
test(s, full, ''),
field('title')
)
Note that you can also use this template in a custom column 'built from other columns'. Sometimes that is useful for debugging and changing things, as you see the results immediately instead of after a send to your kindle.