ad_page_contract_filter_proc_negative_float (public)
ad_page_contract_filter_proc_negative_float name value_varname
Defined in packages/acs-tcl/tcl/tcl-documentation-procs.tcl
Same as float but allows negative numbers too GN: this is deprecated, since "float" allows as well negative numbers
- Parameters:
- name
value_varname
- Author:
- Brian Fenton
- Created:
- 1 December 2004
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_page_contract_filters
Source code: upvar $value_varname value # 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 [_ acs-tcl.lt_Value_is_not_an_decim] return 0 } set value [util::trim_leading_zeros $value] # finally add the signum character again set value "$signum$value" return 1XQL Not present: Generic, PostgreSQL, Oracle