]> Nishi Git Mirror - aya.git/commitdiff
fixed math package
authorSerge A. Zaitsev <zaitsev.serge@gmail.com>
Sun, 30 Aug 2015 12:45:06 +0000 (14:45 +0200)
committerSerge A. Zaitsev <zaitsev.serge@gmail.com>
Sun, 30 Aug 2015 12:45:06 +0000 (14:45 +0200)
zs_ext.go

index cedd88476659f037cb045a62e1e3c90c2e2d1a60..b22ec8852c2bd32e6ff9f6c7b5b49b3b1d6d06d8 100644 (file)
--- a/zs_ext.go
+++ b/zs_ext.go
@@ -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))
 }