{% macro progressbar_full(options) %} {% set max = options['max'] ?? 0 %} {% set current = options['current'] ?? 0 %} {% set open = options['open'] ?? null %} {% set reverseColors = options['reverseColors'] ?? false %} {% set formatter = options['format'] ?? null %} {% set currency = options['currency'] ?? null %} {% set percentDecimals = options['decimals'] ?? 1 %} {% set transPercentOpen = options['trans_percent_open'] ?? 'stats.percentUsedLeft' %} {% set transPercentSpent = options['trans_percent_spent'] ?? 'stats.percentUsed' %} {% if formatter == 'duration' %} {% set currentFormatted = current|duration %} {% set maxFormatted = max|duration %} {% set openFormatted = open is not null ? open|duration : null %} {% elseif formatter == 'money' and currency is not null %} {% set currentFormatted = current|money(currency) %} {% set maxFormatted = max|money(currency) %} {% set openFormatted = open is not null ? open|money(currency) : null %} {% else %} {% set currentFormatted = current %} {% set maxFormatted = max %} {% set openFormatted = open is not null ? open : null %} {% endif %} {% set percentReached = 0 %} {% if max > 0 %} {% set percentReached = (current / (max / 100)) %} {% endif %} {% set width = percentReached|number_format(1, '.', '') %} {% if width > 100 %} {% set width = 100 %} {% endif %}