mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 16:55:15 +00:00
improve balance printing
This commit is contained in:
parent
18d9245b06
commit
8f5491d818
|
@ -15,6 +15,14 @@ type Balance struct {
|
||||||
Locked fixedpoint.Value `json:"locked"`
|
Locked fixedpoint.Value `json:"locked"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (b Balance) String() string {
|
||||||
|
if b.Locked > 0 {
|
||||||
|
return fmt.Sprintf("%s: %f (locked %f)", b.Currency, b.Available.Float64(), b.Locked.Float64())
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmt.Sprintf("%s: %f", b.Currency, b.Available.Float64())
|
||||||
|
}
|
||||||
|
|
||||||
type BalanceMap map[string]Balance
|
type BalanceMap map[string]Balance
|
||||||
|
|
||||||
func (m BalanceMap) Print() {
|
func (m BalanceMap) Print() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user