mirror of
https://github.com/morgan9e/macos-stats
synced 2026-04-14 00:04:15 +09:00
fix: corrected sensors value rounding for the widget (#1000)
This commit is contained in:
@@ -98,14 +98,8 @@ internal struct Sensor: Sensor_p {
|
||||
switch self.type {
|
||||
case .temperature:
|
||||
return Temperature(value).replacingOccurrences(of: "C", with: "").replacingOccurrences(of: "F", with: "")
|
||||
case .voltage:
|
||||
let val = value >= 10 ? "\(Int(value))" : String(format: "%.1f", value)
|
||||
return "\(val)\(unit)"
|
||||
case .power:
|
||||
let val = value >= 10 ? "\(Int(value))" : String(format: "%.1f", value)
|
||||
return "\(val)\(unit)"
|
||||
case .current:
|
||||
let val = value >= 10 ? "\(Int(value))" : String(format: "%.1f", value)
|
||||
case .voltage, .power, .current:
|
||||
let val = value >= 9.95 ? "\(Int(round(value)))" : String(format: "%.1f", value)
|
||||
return "\(val)\(unit)"
|
||||
case .fan:
|
||||
return "\(Int(value))"
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(MARKETING_VERSION)</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>378</string>
|
||||
<string>383</string>
|
||||
<key>Description</key>
|
||||
<string>Simple macOS system monitor in your menu bar</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
|
||||
Reference in New Issue
Block a user