Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
Format temps to 2 digits
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbassi committed May 11, 2018
1 parent 3cd69cb commit c81c3fe
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions widgets/temp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)

}

Expand Down

0 comments on commit c81c3fe

Please sign in to comment.