Is there a way to represent the remainder

So with time minutes is basically represented as x/60. Seconds would be the remainder of the quotients result.

To further explain,
If there’s 130 seconds, 130/60 = 2 10/60 or 2 with a remainder of 10. How would I make the remainder a variable? My script is currently:

local Time = 130
local Minutes = Time/60
local Seconds = "the remainder of 130/60"

To get the remainder of division use the modules (%) operator.

Example:

local Time = 130
local Minutes = Time/60
local Seconds = Time%60

Also if you would like to get the minutes without decimal, use Math.floor:

local Time = 130
local Minutes = math.floor(Time/60)
local Seconds = Time%60

Edit: fixed a capitalization and added the math.floor example

3 Likes

The modulus operator does just that aka. %