Last active
June 23, 2021 10:27
-
-
Save jlabs/1cc2df2ebadc9f60ea8239ab342c1292 to your computer and use it in GitHub Desktop.
Padding of text in Twig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# | |
display the number 9 with 2 0's in front of it | |
%'_3s would display the number 9 with 2 _ in front | |
%'%10s with format("123") would display 123 with 7 % in fron of it | |
% 3s would show 9 and 2 spaces in front | |
%'_-3s would have 9 then 2 _ after it | |
%'x-3s would have 2 x's after | |
#} | |
{{ "%'03s"|format("9") }} = 009 | |
{{ "%'--10s"|format("abc") }} = abc------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment