I’ve searched hi and lo but can’t see to find the answer to this.
Suppose I have a number that represents a quantity of seconds, such as 172.0749999999999. I know that I can display that in a MM:SS format with the following code:
{% set total_seconds = 172.0749999999999 %}
{% set minutes = (total_seconds // 60) % 60 %}
{% set seconds = total_seconds % 60 %}
{{ "%02d:%02d" | format(minutes, seconds) }}
This would display 02:52. If I change the same seconds number to a negative value instead, how can I display it as -02:52? I can’t seem to figure it out.