mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +00:00
display fee only when fee > 0
This commit is contained in:
parent
fb3c198447
commit
7952cf8804
|
@ -168,6 +168,7 @@ func (p *Position) SlackAttachment() slack.Attachment {
|
||||||
|
|
||||||
if p.TotalFee != nil {
|
if p.TotalFee != nil {
|
||||||
for feeCurrency, fee := range p.TotalFee {
|
for feeCurrency, fee := range p.TotalFee {
|
||||||
|
if fee > 0 {
|
||||||
fields = append(fields, slack.AttachmentField{
|
fields = append(fields, slack.AttachmentField{
|
||||||
Title: fmt.Sprintf("Fee (%s)", feeCurrency),
|
Title: fmt.Sprintf("Fee (%s)", feeCurrency),
|
||||||
Value: trimTrailingZeroFloat(fee.Float64()),
|
Value: trimTrailingZeroFloat(fee.Float64()),
|
||||||
|
@ -175,6 +176,7 @@ func (p *Position) SlackAttachment() slack.Attachment {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return slack.Attachment{
|
return slack.Attachment{
|
||||||
// Pretext: "",
|
// Pretext: "",
|
||||||
|
|
Loading…
Reference in New Issue
Block a user