Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class TF:
- def formatar(self, tempo):
- self.tempo = tempo
- return self.get_minutes() + ":" + self.get_seconds() + "." + self.get_milliseconds()
- def get_seconds(self):
- segundos = (int(round((self.tempo / 1000) % 60)))
- if segundos < 10:
- return "0" + str(segundos)
- else:
- return str(segundos)
- def get_minutes(self):
- minuto = (int(round((self.tempo / 60000) % 60)))
- if minuto < 10:
- return "0" + str(minuto)
- else:
- return str(minuto)
- def get_milliseconds(self):
- milis = (int(round((self.tempo % 1000))))
- if milis < 10:
- return "00" + str(milis)
- elif 100 > milis > 10:
- return "0" + str(milis)
- else:
- return str(milis)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement