#Processing Remainder Operation in Macro for Minutes & Seconds Use

1 messages · Page 1 of 1 (latest)

shy hornet
#

Hoping to get some help with replicating the JS % function in MT to handle my mintues and seconds conversion from overall song lengths.

Here is what I -thought- would do it:

  [h: vMinutes = floor(soundLength/60)]
  [g: vSeconds = math.mod(soundLength, 60)]

But it's popping the following error:

Argument number 1 "138.92" to function "math.mod" must be an integer.

Here is a (working) example in JS that I'm basing the formula on...

const vMinutes = Math.floor(count / 60);
const vSeconds = count %60;

Thanks!

modern robin
#

Math.mod(Floor(sound length), 60)