File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -179,9 +179,7 @@ private string GetString()
179179 case SensorType . Energy :
180180 case SensorType . Power :
181181 case SensorType . Data :
182- return Sensor . Value . Value < 10
183- ? $ "{ Sensor . Value : 0.00} ". Substring ( 0 , 3 )
184- : $ "{ Sensor . Value : F0} ";
182+ return Sensor . Value . Value . ToTrayValue ( ) ;
185183 default :
186184 return "-" ;
187185 }
Original file line number Diff line number Diff line change @@ -188,4 +188,10 @@ public static void Destroy(this Icon icon)
188188 DestroyIcon ( icon . Handle ) ;
189189 icon . Dispose ( ) ;
190190 }
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+ }
191197}
You can’t perform that action at this time.
0 commit comments