Reverse order of the arguments in helper "format" in Volt

Hi, I have a question about helpers "format": I expected it to be used as "{{ (item.totalamountuah/item.dollarrate)|format('%.2f') }}" and turned you so "{{ '%.2f'|format(item.totalamountuah/item.dollarrate)}}", it is a mistake?

No it is a convention in Volt where the left operand of the pipe ('|') operator is the first argument of the related php function. Format uses sprintf, and the 1st sprintf argument is the string format, so that the left operand of the pipe is the format.



397

Ok, thank.