Jan
04/08/2022, 4:42 PMakatkov
04/08/2022, 4:45 PMval newMinutes = sum / 60
would get you the number of minutes, but it looks like you’re trying to keep track of the number of hours as wellJan
04/08/2022, 4:46 PMakatkov
04/08/2022, 4:46 PMval seconds = ((seconds % 3600) % 60)
Casey Brooks
04/08/2022, 4:47 PMval sumDuration: Duration = sum.seconds
val totalHours: Long = sumDuration.inWholeHours
val totalMinutes: Long = sumDuration.inWholeMinutes
val totalSeconds: Long = sumDuration.inWholeSeconds
Jan
04/08/2022, 4:51 PMCasey Brooks
04/08/2022, 5:02 PM.toString()
to get a nicely-formatted, human-readable duration. The .toComponents { }
functions split the value out into the component parts if you need to do something else with them