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.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/a2e3c84c-5206-4bc7-9833-3b6eb48b835dn%40googlegroups.com.