Skip to content

Instantly share code, notes, and snippets.

@nicinabox
Created September 22, 2012 19:18
Show Gist options
  • Save nicinabox/3767491 to your computer and use it in GitHub Desktop.
Save nicinabox/3767491 to your computer and use it in GitHub Desktop.
{% capture reading_time %}
{{ 150 | divided_by: 150 }}
{% endcapture %}
<span>
Reading time: about {{ reading_time }}
{% if reading_time == 1 %}
minute
{% else %}
minutes
{% endif %}
</span>
@nicinabox
Copy link
Author

reading_time comes out as 1, however, in the comparison, it thinks reading_time is not 1 (or even '1') and prints out "minutes".

What's going on here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment