FWIW: the line
Code:
index = template('{series_index:0>2s}');
can be replaced with
Code:
idx = field('series_index');
index = contains(idx, '\.', format_number(idx, '05.2f'), format_number(idx, '02d'));
which has much better performance and deals with floating point series indices.
If you want all series indices to be the same length, in the example's case 5 (nn.nn), then you could use
Code:
format_number(field('series_index'), '05.2f')