【发布时间】:2018-12-06 20:30:42
【问题描述】:
我想创建一个 if/else 语句,根据小数点后是否有值,以不同方式打印详细总计。
案例示例:
-
值为395
语句打印
three hundred and ninety five baht only。 -
值为395.50
语句打印
three hundred and ninety five baht and fifty satang。
我无法计算和打印小数点后的值,我将其描述为提醒计算。
{% if folio.total != folio.total | floor %} {{ folio.verbose_total }} baht only {% else %} {{ folio.verbose_total | floor}} baht and {{ folio.verbose_total | remainder calculation}} satang {% endif %}
【问题讨论】: