I have an integer of total time played for my game, but it’s just the total seconds, and I’d like it to come out in minutes and seconds… so like 94 would be 1:34
What I’m currently doing…
//lets call x my total second int
int minutes = Mathf.RoundToInt((x / 60) - 0.5f); //I subtract 0.5 to make sure I always round down
int seconds = x - (minutes * 60);
It works for the most part, but for some reason I get negative numbers if I have lower numbers (I think 10 or under but not sure)
Is there a better way to do it?