modify validation regexp for Float.

Add Float test
Add new Integer test
This commit is contained in:
Colin Kuskie 2006-03-27 00:29:03 +00:00
parent 123886d4a9
commit 1ac514982f
3 changed files with 102 additions and 2 deletions

View file

@ -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;