fixed math package

git-svn-id: file:///srv/svn/repo/aya/trunk@27 cec141ff-132a-4243-88a5-ce187bd62f94
This commit is contained in:
zaitsev.serge
2015-08-30 12:45:06 +00:00
parent 7734ed9f38
commit cdf674daff

View File

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