1 # Copyright 2010 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 CodeDef numeric OrderCheck
9 CodeDef numeric Description Numeric
10 CodeDef numeric Routine <<EOR
13 my ($ref, $name, $value, $msg) = @_;
14 use Scalar::Util qw/looks_like_number/;
16 if (looks_like_number($value)) {
17 return (1, $name, '');
20 return (0, $name, defined($msg) ? $msg : 'not numeric');