Skip to content

Commit

Permalink
chore: simplify depreciation floor at 0
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-hh-aa committed Dec 6, 2024
1 parent 1de4d86 commit cfaec81
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/Property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ export class Property {
let depreciatedComponentValue =
(newComponentValue * depreciationFactor) + maintenanceAddition;

depreciatedComponentValue < 0 ? depreciatedComponentValue = 0 : depreciatedComponentValue
// Do not depreciate below 0
if (depreciatedComponentValue < 0) depreciatedComponentValue = 0

return {
newComponentValue,
Expand Down

0 comments on commit cfaec81

Please sign in to comment.