Quote:
Originally Posted by w00dent0p
Thanks, that explains it. I already went with choice 2.
Can you please clarify the template meaning a little more? Is there a way to achieve a consistent format across both float and integer? i.e. xx.x for both?
|
Sure. If you *know* that you want xx.x and never xx.xx or xx then this does it.
Code:
{author_sort}/{series}/{series_index:format_number(0.1f)} {title} - {authors}
The original template checked to see if the index was a float by comparing its value to its 'floor' (integer part). If they are not the same then if used format_number() to convert it using 2 digits after the decimal, otherwise it used it unchanged. The new template (above) always converts it to use 1 digit after the decimal point regardless of whether it is integer or float.
Also and FWIW: the first template uses
Template Program Mode. The one in this post uses
Single Function Mode. My personal preference is
General Program Mode, but I didn't provide an example in that mode.