Skip to content

Commit

Permalink
Added formating
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew committed Jun 9, 2018
1 parent 51ce545 commit cf005c4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion blockfolio/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@ func (widget *Widget) Refresh() {
/* -------------------- Unexported Functions -------------------- */
func contentFrom(positions *AllPositionsResponse) string {
res := ""
colorName := Config.USTRING("wtf.mods.blockfolio.colors.name")
colorPrice := Config.USTRING("wtf.mods.blockfolio.colors.price")
colorGrows := Config.USTRING("wtf.mods.blockfolio.colors.grows")
colorDrop := Config.USTRING("wtf.mods.blockfolio.colors.drop")
for i := 0; i < len(positions.PositionList); i++ {
res = res + "a"
colorForChange := colorGrows
if positions.PositionList[i].TwentyFourHourPercentChangeFiat <= 0 {
colorForChange = colorDrop
}
res = res + fmt.Sprintf(" [%s]%6s - [%s]%.2f", colorName, positions.PositionList[i].Coin, colorForChange, positions.PositionList[i].TwentyFourHourPercentChangeFiat)
}

return res
Expand Down

0 comments on commit cf005c4

Please sign in to comment.