mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
adjust qutoe currency formatter symbol for fiat currency
This commit is contained in:
parent
952bdf8218
commit
93e297dd7e
|
@ -78,8 +78,20 @@ func (m Market) BaseCurrencyFormatter() *accounting.Accounting {
|
|||
}
|
||||
|
||||
func (m Market) QuoteCurrencyFormatter() *accounting.Accounting {
|
||||
a := accounting.DefaultAccounting(m.QuoteCurrency, m.PricePrecision)
|
||||
a.Format = "%v %s"
|
||||
var format, symbol string
|
||||
|
||||
switch m.QuoteCurrency {
|
||||
case "USDT", "USDC", "USD":
|
||||
symbol = "$"
|
||||
format = "%s %v"
|
||||
|
||||
default:
|
||||
symbol = m.QuoteCurrency
|
||||
format = "%v %s"
|
||||
}
|
||||
|
||||
a := accounting.DefaultAccounting(symbol, m.PricePrecision)
|
||||
a.Format = format
|
||||
return a
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user