Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (self / 604800 > 1) {
- let division = Int((self / 604800).rounded())
- return "\(division)w"
- }
- else if (self / 86400 > 1) {
- let division = Int((self / 86400).rounded())
- if division == 7 {
- return "1w"
- }
- return "\(division)d"
- }
- else if (self / 3600 > 1) {
- let division = Int((self / 3600).rounded())
- if division == 24 {
- return "1d"
- }
- return "\(division)h"
- }
- else if (self / 60 > 1) {
- let division = Int((self / 60).rounded())
- if division == 60 {
- return "1h"
- }
- return "\(division)m"
- }
- else {
- let division = Int(self.rounded())
- return "\(division)s"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement