Min/max function and raw value in template

Hello,

I’m trying to use the min function in a template such that the volume never exceeds 60:

      volume_level: >
        {% if trigger.event.data["state"] == "up" %}
          {{min(states.media_player.denon_avr.attributes.volume_level + 0.06, 60)}}
        {% elif trigger.event.data["state"] == "down" %}
          {{states.media_player.denon_avr.attributes.volume_level - 0.08}}
        {% endif %}

However, there is either a problem with the formatting of “60” or the min function as it does not work! The volume keeps setting higher than 60 as I increase it. Any ideas?