1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

modules/exchangerate: Display exchange rate for one unit of base currency

This commit is contained in:
Indradhanush Gupta 2020-03-16 20:23:15 +05:30
parent e453408457
commit 62e3523d29

View File

@ -56,11 +56,11 @@ func (widget *Widget) content() (string, string, bool) {
out = widget.err.Error()
} else {
for base, rates := range widget.settings.rates {
out += fmt.Sprintf("[%s]Rates from %s[white]\n", widget.settings.common.Colors.Subheading, base)
out += fmt.Sprintf("[%s]1 %s[white] = ", widget.settings.common.Colors.Subheading, base)
idx := 0
for _, cur := range rates {
rate := widget.rates[base][cur]
out += fmt.Sprintf("[%s]%s - %f[white]\n", widget.CommonSettings().RowColor(idx), cur, rate)
out += fmt.Sprintf("[%s]%f %s[white]\n", widget.CommonSettings().RowColor(idx), rate, cur)
idx++
}
}