HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: garthwen on 2010-01-13 02:34:15

Title: filesize in megabytes
Post by: garthwen on 2010-01-13 02:34:15
Can I show filesize in megabytes?
Title: filesize in megabytes
Post by: Zarkon on 2010-01-13 02:36:56
%filesize_natural%. For future reference, see the titleformat reference (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Titleformat_Reference).
Title: filesize in megabytes
Post by: garthwen on 2010-01-13 02:51:11
%filesize_natural%. For future reference, see the titleformat reference (http://wiki.hydrogenaudio.org/index.php?title=Foobar2000:Titleformat_Reference).


Sometimes it's in KB, sometimes in MB.  How to make it always MB?
Title: filesize in megabytes
Post by: Robertina on 2010-01-13 03:33:04
$div(%filesize%,1048576).$num($div($mul($mod(%filesize%,1048576),100),1048576),2)

--------------------------------------------------------
%filesize% displays the size in bytes. WIKIPEDIA says:

Quote
1 Kilobyte (kB) = 1024 Byte, 1 Megabyte (MB) = 1024 Kilobyte = 1024 ยท 1024 Byte = 1.048.576 Byte

That is the reason for this strange 1048576 in the syntax.

Reason for edit: additional hint.
Title: filesize in megabytes
Post by: garthwen on 2010-01-13 19:33:12
Just what I needed. Thanks!
Title: filesize in megabytes
Post by: TuNk77 on 2010-01-15 05:57:49
I use a similar string: $div(%filesize%,1048576).$left($num($muldiv($mod(%_filesize%,1048576),100,1048576),2),2) $get(anno)'MB')