Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CanBeInteger check when value has whitespace #115

Closed
nguyenaiden opened this issue Nov 26, 2018 · 5 comments
Closed

CanBeInteger check when value has whitespace #115

nguyenaiden opened this issue Nov 26, 2018 · 5 comments

Comments

@nguyenaiden
Copy link

For the canBeInteger check, if the value coming in is actually a Number in string form but has leading and trailing white spaces, it is throwing a false. For example,

{% if foo %}
    {{foo | plus: 1}}
{% else %}
    0
{% endif %}

foo in this case actually evaluates to 1.0.
Is adding .trim() to the value in canBeInteger a possible solution?

@bkiers
Copy link
Owner

bkiers commented Nov 27, 2018

Is adding .trim() to the value in canBeInteger a possible solution?

Yes, that should do is. I also added some more .trim()s, see #116

@bkiers
Copy link
Owner

bkiers commented Nov 27, 2018

Thanks for reporting @nguyenaiden!

@bkiers bkiers closed this as completed Nov 27, 2018
@nguyenaiden
Copy link
Author

Hey @bkiers! Do you know when you would be releasing the new changes?

@bkiers
Copy link
Owner

bkiers commented Dec 3, 2018

Hi @nguyenaiden 0.7.7 has just been released, so 0.7.8 will be release in a couple of weeks with (perhaps) some other fixes.

@bkiers
Copy link
Owner

bkiers commented Jan 7, 2019

@nguyenaiden FYI: #118

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants