[Scummvm-git-logs] scummvm-web master -> c8ea57598fd4729259710c2a8728d6bff8d9f032

Thunderforge noreply at scummvm.org
Tue Jun 14 22:23:40 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm-web' repo located at https://github.com/scummvm/scummvm-web .

Summary:
c8ea57598f WEB: Displaying file sizes as MiB etc (#250)


Commit: c8ea57598fd4729259710c2a8728d6bff8d9f032
    https://github.com/scummvm/scummvm-web/commit/c8ea57598fd4729259710c2a8728d6bff8d9f032
Author: Thunderforge (wjherrmann at gmail.com)
Date: 2022-06-14T17:23:37-05:00

Commit Message:
WEB: Displaying file sizes as MiB etc (#250)

This is a result of the discussion from PR #230 where the consensus was that the consistent and accurate, if inconvenient, units (KiB, MiB, GiB) were preferred over the ambiguous units (kB, MB, GB).

Changed paths:
    include/FileUtils.php


diff --git a/include/FileUtils.php b/include/FileUtils.php
index fe8e5afa..ad190b7d 100644
--- a/include/FileUtils.php
+++ b/include/FileUtils.php
@@ -34,15 +34,15 @@ class FileUtils
         $file_size = round((@filesize($path) / 1024));
         
         if ($file_size < 1024) {
-            $file_size = $file_size . "K";
+            $file_size = $file_size . " KiB";
         } else {
             $file_size /= 1024;
 
             if ($file_size < 1024) {
-                $file_size = round($file_size, 1) . "M";
+                $file_size = round($file_size, 1) . " MiB";
             } else {
                 $file_size /= 1024;
-                $file_size = round($file_size, 2) . "G";
+                $file_size = round($file_size, 2) . " GiB";
             }
         }
         return $file_size;




More information about the Scummvm-git-logs mailing list