Index: openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl,v diff -u -N -r1.19 -r1.19.2.1 --- openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 5 Apr 2004 16:34:11 -0000 1.19 +++ openacs-4/packages/acs-tcl/tcl/tcl-documentation-procs.tcl 15 Jun 2005 16:43:23 -0000 1.19.2.1 @@ -1805,20 +1805,30 @@ @author Steven Pulito (stevenp@seas.upenn.edu) @creation-date 22 August 2000 } { + # Check if the first character is a "+" or "-" + set signum "" + if {[regexp {^([\+\-])(.*)} $value match signum rest]} { + set value $rest + } + # remove the first decimal point, the theory being that # at this point a valid float will pass an integer test regsub {\.} $value "" value_to_be_tested if { ![regexp {^[0-9]+$} $value_to_be_tested] } { - ad_complain "Value is not an decimal number." - return 0 + ad_complain "Value is not an decimal number." + return 0 } # trim leading zeros, so as not to confuse Tcl set value [string trimleft $value "0"] if { [empty_string_p $value] } { - # but not all of the zeros - set value "0" + # but not all of the zeros + set value "0" } + + # finally add the signum character again + set value "$signum$value" + return 1 }