There shouldn't be logic in the view. This calculation should be done in the controller and passed to the view on the view model.