kinabalu / obsidian-word-sprint

Obsidian Word Sprint plugin
MIT License
41 stars 6 forks source link

When writing for less than a minute, the average words per minute is a divide by zero #21

Closed kinabalu closed 2 years ago

MalignantCarp commented 2 years ago

Unless I've completely lost it, changing the averageWordsPerMinute calculation to this ought to solve it for all cases where elapsedMilliseconds is not 0:

averageWordsPerMinute: this.getWordCountDisplay() * 1000 * 60 / Math.floor(this.elapsedMilliseconds)

kinabalu commented 2 years ago

fixed in 0.0.20