minor cleanup of formatting
This commit is contained in:
+3
-3
@@ -23,7 +23,7 @@ func RenderTemperatureSensors(console *strings.Builder, proc *proc.Proc) {
|
||||
tempC := sensor.TempC
|
||||
tempF := (tempC * 9 / 5) + 32
|
||||
// \033[K clears from cursor to end of line (prevents lingering chars)
|
||||
fmt.Fprintf(console, "Sensor: %-25s | %5.1f °C (%5.1f °F)\033[K\n", sensor.Name, tempC, tempF)
|
||||
fmt.Fprintf(console, "%-16s | %.3f °C (%.3f °F)\033[K\n", sensor.Name, tempC, tempF)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ func RenderPowerSensors(console *strings.Builder, proc *proc.Proc) {
|
||||
power, _ := proc.SensorReader.ReadPowerSensors()
|
||||
for _, sensor := range power {
|
||||
// \033[K clears from cursor to end of line (prevents lingering chars)
|
||||
fmt.Fprintf(console, "Sensor: %-25s | %5.1f W\033[K\n", sensor.Name, sensor.Watts)
|
||||
fmt.Fprintf(console, "%-16s | %.3f W\033[K\n", sensor.Name, sensor.Watts)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,6 @@ func RenderClockSensors(console *strings.Builder, proc *proc.Proc) {
|
||||
power, _ := proc.SensorReader.ReadClockSensors()
|
||||
for _, sensor := range power {
|
||||
// \033[K clears from cursor to end of line (prevents lingering chars)
|
||||
fmt.Fprintf(console, "Sensor: %-25d | %5.1f GHz\033[K\n", sensor.Name, sensor.FrequencyGHz)
|
||||
fmt.Fprintf(console, "%-16s | %.3f GHz\033[K\n", sensor.Name, sensor.FrequencyGHz)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ type PowerDriver interface {
|
||||
|
||||
type ClockSensor struct {
|
||||
path string
|
||||
Name int
|
||||
Name string
|
||||
FrequencyGHz float64
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ func (r *SysDriver) ReadClockSensors() ([]ClockSensor, error) {
|
||||
|
||||
clockSensors = append(clockSensors, ClockSensor{
|
||||
path: path,
|
||||
Name: coreID,
|
||||
Name: fmt.Sprintf("core %d", coreID),
|
||||
FrequencyGHz: khz / 1000000.0, // Convert KHz to GHz
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user