You *could* do it using a format specifier stored in another custom column.
You'd need to run a calibre-debug script periodically to recalculate the format specifiers.
Reason: a mere template cannot know the metadata for other book records.
And you need to know if there are other books in the series with a decimal series_index.
...
chaley wrote a calibre-debug script for a case like this, I will see if I can track it down for you.
EDIT: Here it is:
https://www.mobileread.com/forums/sho....php?p=2916772