ad_page_contract_filter_proc_float (public)
ad_page_contract_filter_proc_float name value_varname
Defined in packages/acs-tcl/tcl/tcl-documentation-procs.tcl
Checks to make sure that the value in question is a valid number, possibly with a decimal point - randyb took this from the ACS dev bboard
- Parameters:
- name
value_varname
- Author:
- Steven Pulito <stevenp@seas.upenn.edu>
- Created:
- 22 August 2000
- 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