Help - Search - Members - Calendar
Full Version: Converting %_filesize%
Hydrogenaudio Forums > Hosted Forums > foobar2000 > General - (fb2k)
esa372
I've been digging around but I can't seem to find the format string I need.

I'd like to be able to convert "%_filesize%" to a decimal number.

Example:
convert "21257821" to "21.26"
(rounding the last decimal place up or down, accordingly.)

I've tried
CODE
$div(%_filesize%,x)
but that doesn't return decimals.

Heck, I'd even settle for commas, as in converting "21257821" to "21,258".

Any ideas?

Thanks in advance!

~esa
juglesh
CODE
Filesize: $div(%_filesize%,1048576).$muldiv($mod(%_filesize%,1048576),100,1048576) MB


thanks to someone way smarter than me, musicmusic, i think.
esa372
Wow, I never would've figured that one out..!
blink.gif


Thanks, juglesh!
biggrin.gif
Duble0Syx
QUOTE(esa372 @ Nov 29 2004, 06:11 PM)
Wow, I never would've figured that one out..!
blink.gif


Thanks, juglesh! 
biggrin.gif
*

I was just trying to figure out the same thing actually. Seeing that makes me realize I'd have never gotten it on my own. Thanks! smile.gif
musicmusic
QUOTE(juglesh @ Nov 30 2004, 02:24 AM)
CODE
Filesize: $div(%_filesize%,1048576).$muldiv($mod(%_filesize%,1048576),100,1048576) MB


thanks to someone way smarter than me, musicmusic, i think.
*


It needs a $num though, otherwise you will get things like 5.6 instead of 5.06.

$div(%_filesize%,1048576).$num($muldiv($mod(%_filesize%,1048576),100,1048576),2) MB
esa372
QUOTE(musicmusic @ Nov 30 2004, 02:46 AM)
It needs a $num though, otherwise you will get things like 5.6 instead of 5.06.

$div(%_filesize%,1048576).$num($muldiv($mod(%_filesize%,1048576),100,1048576),2) MB


Thanks, musicmusic!

biggrin.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.