adjust qutoe currency formatter symbol for fiat currency

This commit is contained in:
c9s 2021-10-15 11:53:01 +08:00
parent 952bdf8218
commit 93e297dd7e

View File

@ -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
}