Decimal support for events.stream.output.rotate.when

This commit is contained in:
Giuseppe 2018-10-28 22:41:31 +01:00
parent fc7d8d22b4
commit 251dbb3ef2
4 changed files with 28 additions and 6 deletions

View file

@ -109,6 +109,20 @@ func (m SessionModule) IntParam(name string) (error, int) {
}
}
func (m SessionModule) DecParam(name string) (error, float64) {
if p, found := m.params[name]; found {
if err, v := p.Get(m.Session); err != nil {
return err, 0
} else {
return nil, v.(float64)
}
} else {
return fmt.Errorf("Parameter %s does not exist.", name), 0
}
}
func (m SessionModule) BoolParam(name string) (error, bool) {
if err, v := m.params[name].Get(m.Session); err != nil {
return err, false