Quote:
Originally Posted by sha
I'm trying to make my plugboards truncate trailing zeros while maintaining leading zeros.
Example:
Series 01 Title
Series 02 Title
Series 02.5 Title
Series 11 Title
What's happening right now (I've tried variations of 0>2.1f, 0>2s, g, etc):
Series 01.0 Title
Series 02.0 Title
Series 02.5 Title
Series 11.0 Title
or:
Series 1 Title
Series 11 Title
Series 2 Title
Series 2.50 Title
Any help would be appreciated.
|
This
Template Program Mode template does the job. It distinguishes between integer and floating point series numbers, picking different formatting. For floating point numbers it removes any trailing zeros after the number is formatted.
Code:
{series_index:'contains($, '\.', re(format_number($, '0>5.2f'), '0*$', ''), format_number($, '0>2d'))'}