util::trim_leading_zeros (public)

 util::trim_leading_zeros string

Defined in packages/acs-tcl/tcl/utilities-procs.tcl

Returns a string with leading zeros trimmed. Used to get around Tcl interpreter problems without thinking leading zeros are octal.

If string is real and mod(number)<1, then we have pulled off the leading zero; i.e. 0.231 -> .231 - this is still fine for Tcl though...

Parameters:
string (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_util__trim_leading_zeros util__trim_leading_zeros (test acs-tcl) util::trim_leading_zeros util::trim_leading_zeros test_util__trim_leading_zeros->util::trim_leading_zeros ad_page_contract_filter_proc_float ad_page_contract_filter_proc_float (public) ad_page_contract_filter_proc_float->util::trim_leading_zeros ad_page_contract_filter_proc_integer ad_page_contract_filter_proc_integer (public) ad_page_contract_filter_proc_integer->util::trim_leading_zeros ad_page_contract_filter_proc_negative_float ad_page_contract_filter_proc_negative_float (public) ad_page_contract_filter_proc_negative_float->util::trim_leading_zeros ad_page_contract_filter_proc_object_id ad_page_contract_filter_proc_object_id (public) ad_page_contract_filter_proc_object_id->util::trim_leading_zeros ad_page_contract_filter_proc_range ad_page_contract_filter_proc_range (public) ad_page_contract_filter_proc_range->util::trim_leading_zeros

Testcases:
util__trim_leading_zeros
Source code:
    if {$string ne ""} {
        set string [string trimleft $string 0]
        if {$string eq ""} {
            set string 0
        }
    }
    return $string
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/utilities-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: