panlei
2019-08-02 5383ff22874c1f553776b76956f8c6eb08d429ec
ruleserver/readyDataForRule.go
@@ -8,6 +8,7 @@
   "fmt"
   "github.com/go-yaml/yaml"
   "io/ioutil"
   "math"
   "ruleprocess/cache"
   "ruleprocess/logger"
   "strconv"
@@ -93,8 +94,12 @@
   return v
}
func Decimal(value float32) float64 {
   value1, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", value), 64)
   return value1
   value1, _ := strconv.ParseFloat(fmt.Sprintf("%.4f", float64(value)), 64)
   logger.Info("初步保留四位成str:",value1)
   n10 := math.Pow10(4)
   value2 := math.Trunc((value1+0.5/n10)*n10) / n10
   logger.Info("初步保留四位成str::::",value2)
   return value2
}
// 取出某个时间规则的第几天的规则段集合
func GetTimeById(id string, index int) []TimeRange {