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

Problem with ReadingTime::minute method result #3

Open
peter279k opened this issue Mar 23, 2020 · 2 comments
Open

Problem with ReadingTime::minute method result #3

peter279k opened this issue Mar 23, 2020 · 2 comments

Comments

@peter279k
Copy link
Contributor

As title, it seems that ReadingTime::minute method result should be integer type.

......
    public function minutes()
    {
        return str_word_count($this->content) / $this->wordsPerMinute;
    }
......

The original result will return float type and it cannot be used directly after calculating reading time.

I think it should cast this result to be integer type.

@DivineOmega, what do you think about that?

@DivineOmega
Copy link
Owner

@peter279k I think it makes sense that this returns a float. You may want to know if a piece of text will take one and half minutes to read, for example.

@peter279k
Copy link
Contributor Author

@DivineOmega, thanks for your reply.

I think we need to round the returned value because floating point will be unlimited value.

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