Fix bug in isNumber
This commit is contained in:
parent
30744a173f
commit
855307e330
1 changed files with 6 additions and 6 deletions
|
|
@ -77,13 +77,13 @@ function cmpDate ($p_date,$p_date_oth) {
|
|||
*/
|
||||
function isNumber($p_int) {
|
||||
if ( strlen (trim($p_int)) == 0 ) return 0;
|
||||
$p_int=trim($p_int);
|
||||
$p_int=FormatString($p_int);
|
||||
if (! ereg ("^-{0,1}[0-9]+.{0,1}[0-9]*$",$p_int) ) {
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
if ( (string) $p_int === (string) (int) $p_int )
|
||||
return 1;
|
||||
}// !ereg
|
||||
else
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue