Index: openacs-4/packages/file-storage/www/folder-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.tcl,v diff -u -r1.61.2.3 -r1.61.2.4 --- openacs-4/packages/file-storage/www/folder-chunk.tcl 15 Mar 2019 09:40:30 -0000 1.61.2.3 +++ openacs-4/packages/file-storage/www/folder-chunk.tcl 25 Jun 2019 12:45:23 -0000 1.61.2.4 @@ -338,14 +338,7 @@ set content_size_pretty "[lc_numeric $content_size] [_ file-storage.items]" set pretty_type "#file-storage.Folder#" } else { - if { $content_size eq "" } { - set content_size 0 - } - if {$content_size < 1024} { - set content_size_pretty "[lc_numeric $content_size] [_ file-storage.bytes]" - } else { - set content_size_pretty "[lc_numeric [expr {$content_size / 1024 }]] [_ file-storage.kb]" - } + set content_size_pretty [util::content_size_pretty -size $content_size] } if { $content_size ne "" } { @@ -412,11 +405,7 @@ append content_size_pretty " [_ file-storage.items]" set pretty_type "#file-storage.Folder#" } else { - if {$content_size < 1024} { - set content_size_pretty "[lc_numeric $content_size] [_ file-storage.bytes]" - } else { - set content_size_pretty "[lc_numeric [expr {$content_size / 1024 }]] [_ file-storage.kb]" - } + set content_size_pretty [util::content_size_pretty -size $content_size] } set properties_url [export_vars -base ${fs_url}file {{file_id $object_id}}] set new_version_link [_ acs-kernel.common_New] Index: openacs-4/packages/xotcl-core/lib/revisions.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/lib/revisions.tcl,v diff -u -r1.8 -r1.8.2.1 --- openacs-4/packages/xotcl-core/lib/revisions.tcl 18 May 2018 09:32:08 -0000 1.8 +++ openacs-4/packages/xotcl-core/lib/revisions.tcl 25 Jun 2019 12:53:27 -0000 1.8.2.1 @@ -74,11 +74,7 @@ set version_number $version_number: set last_modified_ansi [lc_time_system_to_conn $last_modified_ansi] set last_modified_pretty [lc_time_fmt $last_modified_ansi "%x %X"] - if {$content_size < 1024} { - set content_size_pretty "[lc_numeric $content_size] [_ file-storage.bytes]" - } else { - set content_size_pretty "[lc_numeric [format %.2f [expr {$content_size/1024.0}]]] [_ file-storage.kb]" - } + set content_size_pretty [util::content_size_pretty -size $content_size] if {$name eq ""} {set name [_ file-storage.untitled]} set live_revision_link [export_vars -base make-live-revision \ Index: openacs-4/packages/xotcl-core/tcl/cr-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/cr-procs.tcl,v diff -u -r1.76.2.16 -r1.76.2.17 --- openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 14 May 2019 20:05:05 -0000 1.76.2.16 +++ openacs-4/packages/xotcl-core/tcl/cr-procs.tcl 25 Jun 2019 12:53:27 -0000 1.76.2.17 @@ -1263,12 +1263,7 @@ -orderby "r.revision_id desc"] ::xo::dc foreach revisions_select $sql { - if {$content_length < 1024} { - if {$content_length eq ""} {set content_length 0} - set content_size_pretty "[lc_numeric $content_length] [_ file-storage.bytes]" - } else { - set content_size_pretty "[lc_numeric [format %.2f [expr {$content_length/1024.0}]]] [_ file-storage.kb]" - } + set content_size_pretty [util::content_size_pretty -size $content_length] set last_modified_ansi [lc_time_system_to_conn $last_modified_ansi]