minor cleanup of formatting

This commit is contained in:
alu
2026-08-05 10:12:23 -07:00
parent 4a94bddd92
commit aa114e4f73
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -23,7 +23,7 @@ func RenderTemperatureSensors(console *strings.Builder, proc *proc.Proc) {
tempC := sensor.TempC tempC := sensor.TempC
tempF := (tempC * 9 / 5) + 32 tempF := (tempC * 9 / 5) + 32
// \033[K clears from cursor to end of line (prevents lingering chars) // \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() power, _ := proc.SensorReader.ReadPowerSensors()
for _, sensor := range power { for _, sensor := range power {
// \033[K clears from cursor to end of line (prevents lingering chars) // \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() power, _ := proc.SensorReader.ReadClockSensors()
for _, sensor := range power { for _, sensor := range power {
// \033[K clears from cursor to end of line (prevents lingering chars) // \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)
} }
} }
+1 -1
View File
@@ -22,7 +22,7 @@ type PowerDriver interface {
type ClockSensor struct { type ClockSensor struct {
path string path string
Name int Name string
FrequencyGHz float64 FrequencyGHz float64
} }
+1 -1
View File
@@ -53,7 +53,7 @@ func (r *SysDriver) ReadClockSensors() ([]ClockSensor, error) {
clockSensors = append(clockSensors, ClockSensor{ clockSensors = append(clockSensors, ClockSensor{
path: path, path: path,
Name: coreID, Name: fmt.Sprintf("core %d", coreID),
FrequencyGHz: khz / 1000000.0, // Convert KHz to GHz FrequencyGHz: khz / 1000000.0, // Convert KHz to GHz
}) })
} }