Handle amount in import and display
This commit is contained in:
1 parent
db7f0bfb7b
commit
696469f6c2
3 files changed
+21
-2
No files matched your search
@@ -43,3 +43,13 @@ func (tx Transaction) GetAmount() float64 {
|
||||
}
|
||||
return amount
|
||||
}
|
||||
|
||||
func (tx Transaction) GetAmountString() string {
|
||||
amount := tx.GetAmount()
|
||||
return fmt.Sprintf("%.2f", amount)
|
||||
}
|
||||
|
||||
func (tx Transaction) GetPositive() bool {
|
||||
amount := tx.GetAmount()
|
||||
return amount >= 0
|
||||
}
|
||||
Reference in new issue
Block a user