improved readability of time conversion
This commit is contained in:
		
							parent
							
								
									6f4ab9decd
								
							
						
					
					
						commit
						99dd9126fd
					
				|  | @ -95,12 +95,8 @@ class WebVTTFormatter(Formatter): | ||||||
|         '00:00:06.930' |         '00:00:06.930' | ||||||
|         """ |         """ | ||||||
|         time = float(time) |         time = float(time) | ||||||
|         hours= int(time) // 3600 |         hours, remainder = divmod(time, 3600) | ||||||
|         time= time - hours*3600 |         mins, secs = divmod(remainder, 60) | ||||||
|         mins, secs = ( |  | ||||||
|             int(time) // 60, |  | ||||||
|             int(time) % 60, |  | ||||||
|         ) |  | ||||||
|         ms = int(round((time - int(time))*1000, 2)) |         ms = int(round((time - int(time))*1000, 2)) | ||||||
|         return "{:02d}:{:02d}:{:02d}.{:03d}".format(hours, mins, secs, ms) |         return "{:02d}:{:02d}:{:02d}.{:03d}".format(hours, mins, secs, ms) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue