modify validation regexp for Float.
Add Float test Add new Integer test
This commit is contained in:
parent
123886d4a9
commit
1ac514982f
3 changed files with 102 additions and 2 deletions
|
|
@ -100,7 +100,7 @@ Returns the integer from the form post, or returns 0.0 if the post result is inv
|
|||
sub getValueFromPost {
|
||||
my $self = shift;
|
||||
my $value = $self->session->form->param($self->get("name"));
|
||||
if ($value =~ /^[\d\-\.]+$/) {
|
||||
if ($value =~ /^-?[\d\.]+$/) {
|
||||
return $value;
|
||||
}
|
||||
return 0.0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue