Last active
February 3, 2016 16:00
-
-
Save dyspop/3705f22c9fc6fceff375 to your computer and use it in GitHub Desktop.
Liquid zero start of string fill-ins.
This file contains 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
{% assign user_code_str = event.user.user_code | downcase %} | |
{% capture user_code_length %}{{user_code_str | size}}{% endcapture %} | |
{% capture zeros_missing %}{{'9' | minus: user_code_length}}{% endcapture %} | |
{% capture nine_digit_user_code %}{% for zero in zeros_missing %}0{% endfor %}{{event.user.user_code}}{% endcapture %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment