format

Function format 

Source
pub fn format(
    format_str: &str,
    format_args: Rest<Value>,
) -> Result<String, Error>
Expand description

Apply the given values to a printf-style format string.

{{ "%s, %s!"|format(greeting, name) }}
-> Hello, World!

In many cases, the str.format() style could be more convenient than the printf-style formatting:

{{ "{}, {name}!".format(greeting, name="Alice") }}
-> Hello, Alice!

This option is available through minijinja-contrib’s pycompat feature.