Try to move logic out of the view. What would you call this calculation? Which object does this behavior belong to?