Skip to content

Commit

Permalink
fix: support for negative numbers for decimal parameters (closes #866)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilsocket committed Apr 21, 2021
1 parent 568c166 commit c38de3a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion session/module_param.go
Expand Up @@ -59,7 +59,7 @@ func NewIntParameter(name string, def_value string, desc string) *ModuleParam {
}

func NewDecimalParameter(name string, def_value string, desc string) *ModuleParam {
return NewModuleParameter(name, def_value, FLOAT, "^[\\d]+(\\.\\d+)?$", desc)
return NewModuleParameter(name, def_value, FLOAT, `^[\-\+]?[\d]+(\.\d+)?$`, desc)
}

func (p ModuleParam) validate(value string) (error, interface{}) {
Expand Down

0 comments on commit c38de3a

Please sign in to comment.