add priceVolume helper InQuote

This commit is contained in:
c9s 2024-03-18 17:50:39 +08:00
parent 97c48e5bb4
commit cbf957c7ce
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -12,6 +12,10 @@ type PriceVolume struct {
Price, Volume fixedpoint.Value Price, Volume fixedpoint.Value
} }
func (p PriceVolume) InQuote() fixedpoint.Value {
return p.Price.Mul(p.Volume)
}
func (p PriceVolume) Equals(b PriceVolume) bool { func (p PriceVolume) Equals(b PriceVolume) bool {
return p.Price.Eq(b.Price) && p.Volume.Eq(b.Volume) return p.Price.Eq(b.Price) && p.Volume.Eq(b.Volume)
} }