count_minutes #1

Closed
christian-fei opened this Issue Mar 28, 2013 · 2 comments

Comments

Projects
None yet
2 participants

Hello, first of all thanks for this cool and simple plugin!
I added count_minutes like this:

def count_minutes(input)
    calculate(input) / 5 /60
end

The problem is that if the post is really short (less than a minute of reading time) this gives me 0.
How would you output something like 0.5 minutes when it's like 30 seconds?
It would be cool if you could help me out :)

resolved simple as this:

def count_minutes(input)
      ( calculate(input) / 300.0 ).to_f.round(2);
end
Owner

gummesson commented Mar 28, 2013

Glad you got it working! 👍

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