We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8830f3d commit 4878766Copy full SHA for 4878766
2 files changed
OpenHardwareMonitor/UI/SensorNotifyIcon.cs
@@ -179,9 +179,7 @@ private string GetString()
179
case SensorType.Energy:
180
case SensorType.Power:
181
case SensorType.Data:
182
- return Sensor.Value.Value < 10
183
- ? $"{Sensor.Value:0.00}".Substring(0, 3)
184
- : $"{Sensor.Value:F0}";
+ return Sensor.Value.Value.ToTrayValue();
185
default:
186
return "-";
187
}
OpenHardwareMonitor/Utilities/IconFactory.cs
@@ -188,4 +188,10 @@ public static void Destroy(this Icon icon)
188
DestroyIcon(icon.Handle);
189
icon.Dispose();
190
191
+
192
+ public static string ToTrayValue(this float value)
193
+ {
194
+ double rounded1 = Math.Round(value, 1);
195
+ return rounded1 < 10 ? rounded1.ToString("0.0") : Math.Round(value).ToString("0");
196
+ }
197
0 commit comments