How to interpret File.Size value to be same as shown on file view

Started by ubacher, December 09, 2013, 04:21:34 AM

Previous topic - Next topic

ubacher

I tried to match up the size returned by File.Size in a script with what is shown on the screen (tool-tip etc.)
Thought that dividing by 1024 would give me the same reading - but it does not ( example 1.31 vs 1.34 Mb)
Help please! How to get it to match.

Mario

File size is in bytes =>

FileSize / 1024.0 => KB
FileSize / (1024.0*1024.ΓΌ) => MB

Size in bytes: 94.908
Size in KB: 92.68359375 (Windows Explorer shows 93 KB)
Rounded, as shown in file window : 92.68

Size in bytes: 3684540
KB: 3598.18359375  (Windows Explorer shows 3599 KB)
MB: 3.513851165771484375
Rounded, as shown in file window: 3.51

You can test with these variables:

{File.Size}
{File.Size|format:raw}
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook