Hello, I am using Order Print and the count variable to display a number on my invoices. I need the number to start with: GS000100. For some reason the 3 zeros in the front do not display and I see instead: GS100. Is there a way to fix this? Thank you so much!
Code:
<li class="order_details">
<span class="order-details-title editable" data-key="number"> Gutschrift-Nr. </span>
GS {% assign count = 000098 %}
{% for transaction in refund_transactions %}
{% assign count = count | plus: 1 %}
{{ count | plus: 1 }}
{% endfor %}
</li>
What it displays:
Solved! Go to the solution
This is an accepted solution.
Zeroes in front of the number are stripped, so you need to do some string manipulations like this:
{% assign number = 98 %}
{{ number | prepend: "000000" | slice: -6, 6 }}
The code converts your number to string to prepend "000000" string and then leaves only the last 6 characters.
User | Count |
---|---|
23 | |
20 | |
17 | |
16 | |
14 |