So, I’m making a choose-a-song system, And i wanted to format the current song time position to this 1:17 (using the : pattern)
I already tried doing some code, But it didn’t work, Can anyone help me? (It’s a textlabel on a surface gui, server script)

1 Like
imKirda
(imKirda)
#2
local function Format(Seconds)
local Minutes = Seconds / 60
return string.format("%d:%02d", Minutes, Seconds % 60)
end
%d
for digit, %02d
for digit with at least 2 numbers (turns 9 into 09). You can read about those patterns here.
1 Like