For example i have some of the following Duration
values
0:12:15.000000 // the hour is 0 so i want to display the value like mm-ss => 12:15
0:01:02.000000 // the minutes is less than 10 so i want to display the value like m-ss => 1:02
0:00:05.000000 // the minutes is 0 so i want to the value like m-ss => 0:05
i import these Duration values from video info so i don’t know what was the type of .000000
is . but i want to remove them too .
How could i handle these scenarios in best way 🙂
2
Answers
Assuming you have duration object. You can define your format function something like this and use it.
I guess this might help