| 123456789101112131415161718192021222324252627 |
- //
- // Int+Extension.swift
- // Gami
- //
- // Created by OneeChan on 2026/2/3.
- //
- import Foundation
- extension Int {
- var timeCountDisplay: String {
- if self > 3600 {
- String(format: "%02d:%02d:%02d", self / 3600, self % 3600 / 60, self % 60)
- } else {
- String(format: "%02d:%02d", self / 60, self % 60)
- }
- }
-
- var durationDisplay: String {
- "\(self)“"
- }
-
- func formattedAsShortNumber(fractionDigits: Int = 1) -> String {
- Double(self).formattedAsShortNumber(fractionDigits: fractionDigits)
- }
- }
|