comparison zs_ext.go @ 26:d966bcb229c0 draft

fixed math package
author zaitsev.serge
date Sun, 30 Aug 2015 12:45:06 +0000
parents 42b0a9fa5883
children b2f491299cee
comparison
equal deleted inserted replaced
25:42b0a9fa5883 26:d966bcb229c0
5 "os" 5 "os"
6 "strconv" 6 "strconv"
7 "strings" 7 "strings"
8 "time" 8 "time"
9 9
10 "math"
11
10 "github.com/drhodes/golorem" 12 "github.com/drhodes/golorem"
11 "github.com/google/gxui/math"
12 "github.com/jaytaylor/html2text" 13 "github.com/jaytaylor/html2text"
13 ) 14 )
14 15
15 // zs var <filename> -- returns list of variables and their values 16 // zs var <filename> -- returns list of variables and their values
16 // zs var <filename> <var...> -- returns list of variable values 17 // zs var <filename> <var...> -- returns list of variable values
96 } 97 }
97 98
98 // zs timetoread <file> -- returns number of minutes required to read the text 99 // zs timetoread <file> -- returns number of minutes required to read the text
99 func TimeToRead(args []string) int { 100 func TimeToRead(args []string) int {
100 wc := WordCount(args) 101 wc := WordCount(args)
101 return int(math.Round(float64(wc) / float64(200))) 102 return int(math.Floor(float64(wc)/200.0 + .5))
102 } 103 }