convert transaction with = to normal but pass isSet=true
This commit is contained in:
@@ -14,6 +14,7 @@ type Delta struct {
|
||||
Value float64
|
||||
Currency Currency
|
||||
Description string
|
||||
isSet bool
|
||||
}
|
||||
|
||||
func newDelta(d, desc, name string, v float64, c string) Delta {
|
||||
@@ -36,5 +37,10 @@ func (delta Delta) Plus(other Delta) Delta {
|
||||
}
|
||||
|
||||
func (delta Delta) Debug() string {
|
||||
return fmt.Sprintf("{@%s %s:\"%s\" %.2f %s}", delta.Date, delta.Name, delta.Description, delta.Value, delta.Currency)
|
||||
return fmt.Sprintf("{@%s %s:\"%s\" %s%.2f %s}", delta.Date, delta.Name, delta.Description, func() string {
|
||||
if !delta.isSet {
|
||||
return ""
|
||||
}
|
||||
return "= "
|
||||
}(), delta.Value, delta.Currency)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user