fixed math package

This commit is contained in:
Serge A. Zaitsev 2015-08-30 14:45:06 +02:00
parent 2901049048
commit 2a61f06e5a

View File

@ -7,8 +7,9 @@ import (
"strings"
"time"
"math"
"github.com/drhodes/golorem"
"github.com/google/gxui/math"
"github.com/jaytaylor/html2text"
)
@ -98,5 +99,5 @@ func WordCount(args []string) int {
// zs timetoread <file> -- returns number of minutes required to read the text
func TimeToRead(args []string) int {
wc := WordCount(args)
return int(math.Round(float64(wc) / float64(200)))
return int(math.Floor(float64(wc)/200.0 + .5))
}