diff --git a/Themes/jandedobbeleer.json b/Themes/jandedobbeleer.json index f4a269f2..856dfe5c 100644 --- a/Themes/jandedobbeleer.json +++ b/Themes/jandedobbeleer.json @@ -67,7 +67,7 @@ "charged_color": "#4caf50", "charging_color": "#40c4ff", "discharging_color": "#ff5722", - "postfix": "% " + "postfix": " " } }, { diff --git a/segment_battery.go b/segment_battery.go index 1e874618..91ba9c77 100644 --- a/segment_battery.go +++ b/segment_battery.go @@ -38,7 +38,7 @@ func (b *batt) string() string { return "BATT ERR" } batteryPercentage := bt.Current / bt.Full * 100 - percentageText := fmt.Sprintf("%.0f%%", batteryPercentage) + percentageText := fmt.Sprintf("%.0f", batteryPercentage) var icon string var colorPorperty Property switch bt.State { diff --git a/segment_battery_test.go b/segment_battery_test.go index 84d0f702..f46a3493 100644 --- a/segment_battery_test.go +++ b/segment_battery_test.go @@ -39,7 +39,7 @@ func TestBatteryCharging(t *testing.T) { }, } b := setupBatteryTests(battery.Charging, 80, props) - assert.Equal(t, "charging 80%", b.string()) + assert.Equal(t, "charging 80", b.string()) } func TestBatteryCharged(t *testing.T) { @@ -49,7 +49,7 @@ func TestBatteryCharged(t *testing.T) { }, } b := setupBatteryTests(battery.Full, 100, props) - assert.Equal(t, "charged 100%", b.string()) + assert.Equal(t, "charged 100", b.string()) } func TestBatteryDischarging(t *testing.T) { @@ -59,7 +59,7 @@ func TestBatteryDischarging(t *testing.T) { }, } b := setupBatteryTests(battery.Discharging, 70, props) - assert.Equal(t, "going down 70%", b.string()) + assert.Equal(t, "going down 70", b.string()) } func TestBatteryBackgroundColor(t *testing.T) {