Index: openacs-4/packages/acs-admin/www/users/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/index.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/acs-admin/www/users/index.tcl 6 Sep 2022 06:50:08 -0000 1.6.2.1 +++ openacs-4/packages/acs-admin/www/users/index.tcl 6 Sep 2022 07:40:51 -0000 1.6.2.2 @@ -19,7 +19,7 @@ db_1row users_n_users {} db_1row users_deleted_users {} -set n_users [util_commify_number $n_users] +set n_users [lc_numeric $n_users] set last_registration [lc_time_fmt $last_registration "%q"] set groups "<option value='' selected>--</option>\n" Index: openacs-4/packages/acs-subsite/www/admin/group-types/delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/group-types/delete.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/acs-subsite/www/admin/group-types/delete.tcl 16 May 2019 09:54:29 -0000 1.7.2.1 +++ openacs-4/packages/acs-subsite/www/admin/group-types/delete.tcl 6 Sep 2022 07:40:51 -0000 1.7.2.2 @@ -85,13 +85,13 @@ set export_form_vars [export_vars -form {group_type return_url}] -set groups_of_this_type [util_commify_number [db_string groups_of_this_type { +set groups_of_this_type [lc_numeric [db_string groups_of_this_type { select count(o.object_id) from acs_objects o where o.object_type = :group_type }]] -set relations_to_this_type [util_commify_number [db_string relations_to_this_type { +set relations_to_this_type [lc_numeric [db_string relations_to_this_type { select count(r.rel_id) from acs_rels r where r.rel_type in (select t.rel_type Index: openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl,v diff -u -r1.10.2.2 -r1.10.2.3 --- openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl 6 Sep 2022 06:51:35 -0000 1.10.2.2 +++ openacs-4/packages/acs-subsite/www/admin/rel-segments/one.tcl 6 Sep 2022 07:40:51 -0000 1.10.2.3 @@ -76,7 +76,7 @@ where map.segment_id = :segment_id and acs_permission.permission_p(map.party_id, :user_id, 'read') } -set number_elements [util_commify_number $number_elements] +set number_elements [lc_numeric $number_elements] set admin_p [permission::permission_p -object_id $segment_id -privilege "admin"] 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.189.2.140 -r1.189.2.141 --- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 6 Sep 2022 05:48:35 -0000 1.189.2.140 +++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 6 Sep 2022 07:40:51 -0000 1.189.2.141 @@ -1010,10 +1010,15 @@ # putting commas into numbers (thank you, Michael Bryzek) -ad_proc -public util_commify_number { num } { +ad_proc -deprecated util_commify_number { num } { Returns the number with commas inserted where appropriate. Number can be positive or negative and can have a decimal point. e.g. -1465.98 => -1,465.98 + + DEPRECATED: this proc has been long superseded by lc_numeric, + which also supports different locales and formats. + + @see lc_numeric } { while { 1 } { # Regular Expression taken from Mastering Regular Expressions (Jeff Friedl) @@ -1032,6 +1037,13 @@ Should be called at end of private Tcl library files so that it is easy to see in the error log whether or not private Tcl library files contain errors. + + DEPRECATED: this proc is a leftover from the past, OpenACS does + inform about libraries being loaded in the logfile. If one needs a + special statement for debugging purposes, a custom ns_log oneliner + will do. + + @see ns_log } { set tentative_path [info script] regsub -all -- {/\./} $tentative_path {/} scrubbed_path Index: openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl,v diff -u -r1.71.2.48 -r1.71.2.49 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 23 Mar 2022 18:55:59 -0000 1.71.2.48 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 6 Sep 2022 07:40:51 -0000 1.71.2.49 @@ -809,31 +809,31 @@ aa_register_case \ -cats {api smoke production_safe} \ - -procs util_commify_number \ - util__commify_number { + -procs lc_numeric \ + lc__commify_number { - Test util_commify_number + Test lc_numeric @creation-date 2018-09-18 @author Héctor Romojaro <hector.romojaro@gmail.com> } { - aa_equals "Empty value" [util_commify_number {}] {} - aa_equals "0" [util_commify_number 0] {0} - aa_equals "0.0" [util_commify_number 0.0] {0.0} - aa_equals ".0" [util_commify_number .0] {.0} - aa_equals "100" [util_commify_number 100] {100} - aa_equals "1000" [util_commify_number 1000] {1,000} - aa_equals "1000000" [util_commify_number 1000000] {1,000,000} - aa_equals "1000000000" [util_commify_number 1000000000] {1,000,000,000} - aa_equals "1000000000.0002340" [util_commify_number 1000000000.0002340] {1,000,000,000.0002340} - aa_equals "-0" [util_commify_number -0] {-0} - aa_equals "-.0" [util_commify_number -.0] {-.0} - aa_equals "-.0000" [util_commify_number -.0000] {-.0000} - aa_equals "-100" [util_commify_number -100] {-100} - aa_equals "-1000" [util_commify_number -1000] {-1,000} - aa_equals "-1000000" [util_commify_number -1000000] {-1,000,000} - aa_equals "-1000000000" [util_commify_number -1000000000] {-1,000,000,000} - aa_equals "-1000000000.0002340" [util_commify_number -1000000000.0002340] {-1,000,000,000.0002340} + aa_equals "Empty value" [lc_numeric {} "" en_US] {} + aa_equals "0" [lc_numeric 0 "" en_US] {0} + aa_equals "0.0" [lc_numeric 0.0 "" en_US] {0.0} + aa_equals ".0" [lc_numeric .0 "" en_US] {.0} + aa_equals "100" [lc_numeric 100 "" en_US] {100} + aa_equals "1000" [lc_numeric 1000 "" en_US] {1,000} + aa_equals "1000000" [lc_numeric 1000000 "" en_US] {1,000,000} + aa_equals "1000000000" [lc_numeric 1000000000 "" en_US] {1,000,000,000} + aa_equals "1000000000.0002340" [lc_numeric 1000000000.0002340 "" en_US] {1,000,000,000.0002340} + aa_equals "-0" [lc_numeric -0 "" en_US] {-0} + aa_equals "-.0" [lc_numeric -.0 "" en_US] {-.0} + aa_equals "-.0000" [lc_numeric -.0000 "" en_US] {-.0000} + aa_equals "-100" [lc_numeric -100 "" en_US] {-100} + aa_equals "-1000" [lc_numeric -1000 "" en_US] {-1,000} + aa_equals "-1000000" [lc_numeric -1000000 "" en_US] {-1,000,000} + aa_equals "-1000000000" [lc_numeric -1000000000 "" en_US] {-1,000,000,000} + aa_equals "-1000000000.0002340" [lc_numeric -1000000000.0002340 "" en_US] {-1,000,000,000.0002340} } aa_register_case \ Index: openacs-4/packages/attachments/www/file-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/www/file-add-2.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/attachments/www/file-add-2.tcl 14 Feb 2019 16:15:01 -0000 1.9.2.1 +++ openacs-4/packages/attachments/www/file-add-2.tcl 6 Sep 2022 07:40:52 -0000 1.9.2.2 @@ -30,7 +30,7 @@ set max_bytes [fs::max_upload_size -package_id $fs_package_id] if { $n_bytes > $max_bytes } { # Max number of bytes is used in the error message - set max_number_of_bytes [util_commify_number $max_bytes] + set max_number_of_bytes [lc_numeric $max_bytes] ad_complain "[_ attachments.lt_Your_file_is_larger_t]" } } Index: openacs-4/packages/chat/www/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/chat/www/search.tcl,v diff -u -r1.2.2.2 -r1.2.2.3 --- openacs-4/packages/chat/www/search.tcl 15 Jul 2022 13:35:12 -0000 1.2.2.2 +++ openacs-4/packages/chat/www/search.tcl 6 Sep 2022 07:40:52 -0000 1.2.2.3 @@ -9,7 +9,7 @@ db_1row users_n_users {} -set n_users [util_commify_number $n_users] +set n_users [lc_numeric $n_users] set last_registration [lc_time_fmt $last_registration "%q"] set groups [db_html_select_value_options groups_select { Index: openacs-4/packages/dotlrn/www/community-edit-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/community-edit-2.tcl,v diff -u -r1.23.2.3 -r1.23.2.4 --- openacs-4/packages/dotlrn/www/community-edit-2.tcl 1 Feb 2021 11:04:50 -0000 1.23.2.3 +++ openacs-4/packages/dotlrn/www/community-edit-2.tcl 6 Sep 2022 07:40:52 -0000 1.23.2.4 @@ -78,7 +78,7 @@ && $tmp_size > $maxFileSize } { set msg_subst_list [list system_name [ad_system_name] \ - max_attachments_bytes [util_commify_number $maxFileSize]] + max_attachments_bytes [lc_numeric $maxFileSize]] ad_return_complaint 1 "<li>[_ dotlrn.your_icon_is_too_large $msg_subst_list]" ad_script_abort } Index: openacs-4/packages/dotlrn-homework/www/file-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-homework/www/file-add.tcl,v diff -u -r1.7.2.1 -r1.7.2.2 --- openacs-4/packages/dotlrn-homework/www/file-add.tcl 31 Aug 2022 09:44:28 -0000 1.7.2.1 +++ openacs-4/packages/dotlrn-homework/www/file-add.tcl 6 Sep 2022 07:40:52 -0000 1.7.2.2 @@ -56,7 +56,7 @@ } -validate { {upload_file { [file size [template::util::file::get_property tmp_filename $upload_file]] <= [parameter::get -parameter "MaximumFileSize"] } - "[_ dotlrn-homework.lt_your_file_is] ([util_commify_number [parameter::get -parameter MaximumFileSize]] [_ dotlrn-homework.bytes])" + "[_ dotlrn-homework.lt_your_file_is] ([lc_numeric [parameter::get -parameter MaximumFileSize]] [_ dotlrn-homework.bytes])" } } -new_data { Index: openacs-4/packages/dotlrn-homework/www/version-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-homework/www/version-add.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/dotlrn-homework/www/version-add.tcl 31 Aug 2022 09:44:28 -0000 1.6.2.1 +++ openacs-4/packages/dotlrn-homework/www/version-add.tcl 6 Sep 2022 07:40:52 -0000 1.6.2.2 @@ -36,7 +36,7 @@ } -validate { {upload_file { [file size [template::util::file::get_property tmp_filename $upload_file]] <= [parameter::get -parameter "MaximumFileSize"] } - "[_ dotlrn-homework.lt_your_file_is] ([util_commify_number [parameter::get -parameter MaximumFileSize]] [_ dotlrn-homework.bytes])" + "[_ dotlrn-homework.lt_your_file_is] ([lc_numeric [parameter::get -parameter MaximumFileSize]] [_ dotlrn-homework.bytes])" } } -edit_data {