Skip to content
Permalink
Browse files

Format temps to 2 digits

  • Loading branch information...
cjbassi committed May 11, 2018
1 parent 3cd69cb commit c81c3feee8dcf43f6ad36f7d69d4831e4a4b74f8
Showing with 4 additions and 4 deletions.
  1. +4 −4 widgets/temp.go
@@ -55,13 +55,13 @@ func (self *Temp) update() {
}
}

// Buffer implements ui.Bufferer interface.
// Buffer implements ui.Bufferer interface and renders the widget.
func (self *Temp) Buffer() *ui.Buffer {
buf := self.Block.Buffer()

var keys []string
for k := range self.Data {
keys = append(keys, k)
for key := range self.Data {
keys = append(keys, key)
}
sort.Strings(keys)

@@ -77,7 +77,7 @@ func (self *Temp) Buffer() *ui.Buffer {

s := ui.MaxString(key, (self.X - 4))
buf.SetString(1, y+1, s, self.Fg, self.Bg)
buf.SetString(self.X-2, y+1, fmt.Sprintf("%dC", self.Data[key]), fg, self.Bg)
buf.SetString(self.X-2, y+1, fmt.Sprintf("%2dC", self.Data[key]), fg, self.Bg)

}

0 comments on commit c81c3fe

Please sign in to comment.
You can’t perform that action at this time.