Adding DataUsageMultiplyFactor within CDRC

This commit is contained in:
DanB
2014-10-22 13:45:21 +02:00
parent 573aeea9be
commit cbc7a5095c
9 changed files with 66 additions and 10 deletions

View File

@@ -211,7 +211,7 @@ func CopyHour(src, dest time.Time) time.Time {
// Parses duration, considers s as time unit if not provided, seconds as float to specify subunits
func ParseDurationWithSecs(durStr string) (time.Duration, error) {
if durSecs, err := strconv.ParseFloat(durStr, 64); err == nil { // Seconds format considered
durNanosecs := int(durSecs * 1000000000)
durNanosecs := int(durSecs * NANO_MULTIPLIER)
return time.Duration(durNanosecs), nil
} else {
return time.ParseDuration(durStr)