mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
types: fix net asset value display in telegram
This commit is contained in:
parent
59b1e52439
commit
850f3c86ba
|
@ -59,25 +59,26 @@ func (m AssetMap) PlainText() (o string) {
|
|||
usd := a.InUSD
|
||||
btc := a.InBTC
|
||||
if !a.InUSD.IsZero() {
|
||||
o += fmt.Sprintf(" %s: %s (≈ %s) (≈ %s)",
|
||||
o += fmt.Sprintf(" %s: %s (≈ %s) (≈ %s)",
|
||||
a.Currency,
|
||||
a.Total.String(),
|
||||
a.NetAsset.String(),
|
||||
USD.FormatMoney(usd),
|
||||
BTC.FormatMoney(btc),
|
||||
) + "\n"
|
||||
sumUsd = sumUsd.Add(usd)
|
||||
sumBTC = sumBTC.Add(btc)
|
||||
} else {
|
||||
o += fmt.Sprintf(" %s: %s",
|
||||
o += fmt.Sprintf(" %s: %s",
|
||||
a.Currency,
|
||||
a.Total.String(),
|
||||
a.NetAsset.String(),
|
||||
) + "\n"
|
||||
}
|
||||
}
|
||||
o += fmt.Sprintf(" Summary: (≈ %s) (≈ %s)",
|
||||
|
||||
o += fmt.Sprintf("Net Asset Value: (≈ %s) (≈ %s)",
|
||||
USD.FormatMoney(sumUsd),
|
||||
BTC.FormatMoney(sumBTC),
|
||||
) + "\n"
|
||||
)
|
||||
return o
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user