I am parsing YouTube JSON-C GDATA feeds and as it is JSON it can not contain a colon (:) so when I parse the string duration it comes as plain text i.e 823 or 2421. how would I format this to be more readable? i.e 823 –> 8:23 or 2421 –> 24.21 or 23 –> 0:23?
Share
This code should do it:
And you can continue to add
case(5)if you expect a length in hours.Good Luck!