📜  https:forum.manager.io t currency-for-amount-in-words 22025 3 - 无论代码示例

📅  最后修改于: 2022-03-11 14:56:05.677000             🧑  作者: Mango

代码示例1
{% capture amount %}{% for total in table.totals %}{% if total.label == "Total" %}{{ total.text }}{% endif %}{% endfor %}{% endcapture %}
{% capture anc %}{% for total in table.totals %}{% if total.label == "Total" %}{% assign an=total.number %}{% endif %}{% endfor %}{% endcapture %}
{% capture amount_in_words %}{% for total in table.totals %}{% if total.label == "Total" %}{{ total.number | spell_out }}{% endif %}{% endfor %}{% endcapture %}
{% capture cents%}{{an| plus: 0 | modulo: 1| times: 100 | round: 0}}{%endcapture%}
{% capture cents_in_words %}{% if cents != "0" %}{{cents|prepend: " and " | append: "/100 "}}{%else%} Only{% endif %}{% endcapture %}
{{amount_in_words}}{{cents_in_words}}