Strange/wrong unexpected file size

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
Eftegarie
Posts: 4
Joined: 02 Aug 2018 21:32

Strange/wrong unexpected file size

Post by Eftegarie »

Question on file size
I have my list file size sorted as "Flexible (Rounded up)"
I have a PDF file which is 3.12 MB (and 3.13 size on disk)

However XYplorer rounds this up as 4MB
Shouldn't this be 3MB?

Can anybody explain how a 3.12MB file is rounded as a 4MB file? :)

Apart from this I am very very happy with the flexible numbers such as "xxx bytes" next to "xxx KB" "xxx MB" and "xxx GB" all in the same listing! BRILLIANT!

jupe
Posts: 2794
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Strange/wrong unexpected file size

Post by jupe »

The answer is in (Rounded Up) if it said (Rounded) instead you would get the result you are saying, but unsurprisingly Rounded Up rounds up not down.

admin
Site Admin
Posts: 60590
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Strange/wrong unexpected file size

Post by admin »

Rounding up this number has a tradition (in File Explorer) that goes back to at least Win95. The thinking behind it might stem from the use of the clusters on the disk: If only 1 byte is used the whole cluster is used up and not available for other files.

If you don't like the rounding of "Flexible (Rounded up)" simply choose "Flexible" as size format. :)

Eftegarie
Posts: 4
Joined: 02 Aug 2018 21:32

Re: Strange/wrong unexpected file size

Post by Eftegarie »

Thanks for your replies guys. That does explains it why!

BUT im still not seeing what I want to see :roll:

The Flexible option gives too much information (I lose my overview) because of the two numbers and the decimal added behind so instead of a nice neat number like 3 MB, I see 3.13 MB and thus the overview is lost looking at 40 files in one overview.

What I would like is an option that DOES round, but just not following the (ehum excuse me) ancient Win95 cluster HDD size :titter: , but a more logical AND practical office environment size rounding!

Please show 3.13 as 3 MB Thats all I am asking for :)
I like the tiny files showing 431 Bytes just like now Flexible (Rounded Up) shows. So the new option could be a duplicate clone of the old Rounded Up EXCEPT that showing MB doesnt round UP, but just rounds according to whats logical to human office people and us engineers. The new option which I am missing could be called:

Flexible (Rounded)

For 80$ which I paid for this file explorer, which is worth every penny, I THOUGHT that this option was implemented and ready to use!

Now it seems its not possible yet but Im confident the designers/developers will value real human users more than (cluster obsessed) robot hard drives from Windows 95 era :lol:

3.13 MB should be shown as 3MB, thats logical rounding to me!
And every human with keen eyes will appreciate the Flexible (Rounded) option!
Its an upgrade for your program and I'm sure others will appreciate it :)

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Strange/wrong unexpected file size

Post by highend »

Try a custom column...

Type this into the address bar:
snippet;

Hit the {ENTER} key

Copy and paste this code into that new window and add the new custom column "Size (rounded)" to your view:

Code: Select all


Snip: CustomColumn 1
  XYplorer 19.10.0102, 06.08.2018 15:13:03
Action
  ConfigureColumn
Caption
  Size (Rounded)
Type
  3
Definition
      $kb = 0x400;
      $mb = 0x100000;
      $gb = 0x40000000;
      $tb = $gb * 1024;

      $rawSize = property("size", <cc_item>);

      if ($rawSize >= $tb)     { $rounded = round($rawSize / $tb) . " TB"; }
      elseif ($rawSize >= $gb) { $rounded = round($rawSize / $gb) . " GB"; }
      elseif ($rawSize >= $mb) { $rounded = round($rawSize / $mb) . " MB"; }
      elseif ($rawSize >= $kb) { $rounded = round($rawSize / $kb) . " KB"; }
      else { $rounded = $rawSize . " bytes"; }
      return $rounded;
Format
  1
Trigger
  1
Item Type
  0
Item Filter


One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 60590
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Strange/wrong unexpected file size

Post by admin »

Just to make sure: Uprounding the file sizes is not something *from* Windows 95 but *since* Windows 95. It's still here in Windows 10.

The cluster thing was just a theory. Here is another one: With normal rounding all files < 512 bytes would show as "0 KB". No less confusing ain't it?

Eftegarie
Posts: 4
Joined: 02 Aug 2018 21:32

Re: Strange/wrong unexpected file size

Post by Eftegarie »

LOL hehe yea I belive the English saying for this is "You opened a can of worms" which someone can now accuse me of hehe
Slowly I start to see that what I want is indeed not as straight forward clear cut cake as I thought...

I think what I want is some kind of "Best of all worlds".

Where by tiny files say.... (here we go somebody has to custom set something here!) smaller than 1 (our first variable) KB is kept naked showing 0 - 1023 bytes. As soon as it becomes 1024 Bytes then show 1KB. Anything smaller than 1023 KB is shown as KB rounded in the logical way, up untill 1024 K in which case it is shown as 1 MB. till 1023MB, after which is becomes 1GB. Meanwhile rounding of MB not in the Win95 way but in "logical practical" way, where 3.12MB is rounded (read: shown) as 3MB file size, instead of 4MB file size.

Before I tried that script (for which thanks!) fearing that I might break something, and before I embed custom scripts into my "clean" install I first wanted to be sure I can manage/change/delete such scripts into my program. I found the option "Try script" and pasted the script into there and clicked OK.

BUT nothing is changed. The 3.12MB file is still shown as a 4Mb file.
What have I overlooked? Thanks!

highend
Posts: 13327
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Strange/wrong unexpected file size

Post by highend »

What have I overlooked? Thanks!
What do you want me to say? You didn't follow the instructions...
It's a script for custom columns, you can't execute it (without any modifications) as a "normal" script
One of my scripts helped you out? Please donate via Paypal

Post Reply