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

Humanize.truncateWords returns null when input has less number of words #84

Open
KrishnaPG opened this issue Oct 5, 2016 · 0 comments

Comments

@KrishnaPG
Copy link

Humanize.truncateWords("hello world", 2)
null
Humanize.truncateWords("hello world", 1)
"hello ..."

The primary reason one wants to use methods such as truncateWords is if the size increases beyond certain point, truncate it (and leave it untouched if input is smaller in length). Currently the method is returning null if input has less no. of words than requested.

blakeyc added a commit to blakeyc/humanize that referenced this issue Jan 3, 2017
blakeyc added a commit to blakeyc/humanize that referenced this issue Jan 4, 2017
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

1 participant