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