Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v diff -u -r1.140.2.58 -r1.140.2.59 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 2 Feb 2017 11:26:35 -0000 1.140.2.58 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 13 Feb 2017 14:08:42 -0000 1.140.2.59 @@ -4914,8 +4914,26 @@ return $info } +ad_proc util::trim_leading_zeros { + string +} { + Returns a string w/ leading zeros trimmed. + Used to get around Tcl interpreter problems w/ 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... +} { + set string [string trimleft $string 0] + if {$string eq ""} { + return 0 + } + return $string +} + ad_proc -public ad_log { level message @@ -4981,10 +4999,11 @@ } return $result } +} - } + # Local variables: # mode: tcl # tcl-indent-level: 4