mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Added formating
This commit is contained in:
parent
51ce545833
commit
cf005c48f5
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user