mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
- fix battery time when calculating
This commit is contained in:
@@ -194,6 +194,11 @@ public extension Double {
|
||||
|
||||
func printSecondsToHoursMinutesSeconds(short: Bool = false) -> String {
|
||||
let (h, m) = self.secondsToHoursMinutesSeconds()
|
||||
|
||||
if self == 0 || h < 0 || m < 0 {
|
||||
return "n/a"
|
||||
}
|
||||
|
||||
let minutes = m > 9 ? "\(m)" : "0\(m)"
|
||||
|
||||
if short {
|
||||
|
||||
Reference in New Issue
Block a user