token_number_sprintf
35 sites
No security coverage
This module adds a dynamic "Formatted" token for decimal, float, and integer fields that allows the use of a sprintf formatting string to format the number.
Note that this is a simple application of the function using a single value:
sprintf($your_format_string, $numeric_field_value);
A formatting string that expects multiple values will produce no output.
Use case
We had a need for this functionality when we needed to generate automatic entity labels for nodes that included a number field, and needed that number padded with leading zeroes in the labels.