Add method which puts all expenses on equal comparison grounds.
This commit is contained in:
1 parent
78a407d0ec
commit
15fa4aadbd
1 file changed
+4
@@ -15,4 +15,8 @@ class Expense {
|
||||
String toString() {
|
||||
return "$name, $cost, ${frequency.title}, $description";
|
||||
}
|
||||
|
||||
double calcComparableCost() {
|
||||
return cost * frequency.timesPerYear;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user