I tried Django template built-in filter "stringformat" to fixed string length to 3 for example assume I have variable name "data" contain "A1" I want to display this variable as "A1 " (1 blank space) so my code is
{{ data|stringformat:":<3s" }} --> Result is None
so I tried another 6 examples
{{ data|stringformat:":<3" }} --> Result is None
{{ data|stringformat:"{:<3}" }} --> Result is None
{{ data|stringformat:":3" }} --> Result is None
{{ data|stringformat:"{:3}" }} --> Result is None
{{ data|stringformat:":<3s" }} --> Result is None
{{ data|stringformat:"3s" }} --> Result is "A1" not "A1 "
I'm not sure what I'm missing, I cannot find answer online if anyone could help I would be appriciate.