Help - Search - Members - Calendar
Full Version: modulus isn't working right
Hydrogenaudio Forums > Hosted Forums > foobar2000 > Support - (fb2k)
matth6546
i've been fooling around with the $mod command trying to make it display the percentage of time_elapsed / time_total (both in seconds) and i've discovered that the modulus command, $mod(x,y), just outputs x.

i've been using $mod to figure out filesizes (the 3 digits after the decimal). it outputs a number (that isn't x) but i just checked the math and it's wrong.

what's up with the $mod command?
Zoom
QUOTE(matth6546 @ Apr 23 2005, 01:02 AM)
i've been fooling around with the $mod command trying to make it display the percentage of time_elapsed / time_total (both in seconds) and i've discovered that the modulus command, $mod(x,y), just outputs x.

i've been using $mod to figure out filesizes (the 3 digits after the decimal). it outputs a number (that isn't x) but i just checked the math and it's wrong.

what's up with the $mod command?
*


As explained in the titleformatting help, "Calculates remainder of x divided by y." Thus the remainder of time_elapsed divided by time_total is always going to be time_elapsed because time_total is always a larger number until the song ends. The best way to do a percentage for length IMO is:

CODE
$muldiv(%_time_elapsed_seconds%,100,%_length_seconds%)
matth6546
ok, i just looked up what modulus is, i had the wrong idea. and after i stopped using $mod, i figured out that calculation you provided
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.