- fix battery time when calculating

This commit is contained in:
Serhiy Mytrovtsiy
2020-10-31 21:30:01 +01:00
parent c39b91c0b8
commit 7e2d552094

View File

@@ -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 {