Add BudgetOverview.maxValue convenience field
This commit is contained in:
parent
b242974544
commit
3c40566094
1 changed files with 8 additions and 0 deletions
|
@ -17,6 +17,14 @@ public struct Budget: Identifiable, Hashable, Codable {
|
|||
public struct BudgetOverview: Equatable {
|
||||
public let budget: Budget
|
||||
public let balance: Int
|
||||
public var maxValue: Float {
|
||||
get {
|
||||
return Float(max(
|
||||
max(expectedIncome, actualIncome),
|
||||
max(expectedExpenses, actualExpenses)
|
||||
))
|
||||
}
|
||||
}
|
||||
public var expectedIncome: Int
|
||||
public var actualIncome: Int
|
||||
public var expectedExpenses: Int
|
||||
|
|
Loading…
Reference in a new issue