0

Minutes into Minutes and Seconds c#

Eg 180.2 minutes into 180 minutes and 12 seconds in C#

21st Jul 2022, 8:32 PM
Ash 07
Ash 07 - avatar
3 Respostas
+ 2
I would make a Programm which Takes away the minutes also here 180 minutes, so that we only have 0.2. The Formular then would be 2*6= 12 String[] num = 180.2.Split('.'); nun[1] = (Int.Parse(num[1])*6).ToString(); Roughly written but I think you got the conzept. 😉
21st Jul 2022, 8:47 PM
Felix Alcor
Felix Alcor - avatar
+ 2
Truncate or convert to integer to get minutes (180). Subtract that integer from the original value (180.2 - 180) = 0.2 and multiply by 60 to convert into seconds (0.2)*60 = 12. 180 minutes and 12 seconds
21st Jul 2022, 9:24 PM
Brian
Brian - avatar
+ 2
Thank you, I managed to do it now
22nd Jul 2022, 7:02 AM
Ash 07
Ash 07 - avatar