Plugin Author
berkux
(@berkux)
Hi duf,
The pro plugin can do this by using twig in the template:
https://twig.symfony.com/doc/2.x/filters/round.html
Bernhard
Thread Starter
Duf
(@duf)
I see the round function but what about dividing the value by 60 first?
Plugin Author
berkux
(@berkux)
Thread Starter
Duf
(@duf)
Ok I see. I am an absolute novice at this. How would an example line of twig code look that takes a JSON field, divides it by 60 and then rounds it to the next number? Thanks in advance for any help you can offer, I have the plug in doing what I need I just need this last piece to get it formatted correctly.
Thread Starter
Duf
(@duf)
I am so close I just can’t get this twig template to execute the math, otherwise it is pulling the data. My JSON data starts with [{ so I am doing it as you described.
{% for item in _context %}
{{item.name}} <br>
Customers Waiting: {{item.customersWaiting}} <br>
({% set wait_min= (waitingTime/60)|round %}Estimated wait time: {{wait_min}} minutes) <br>
<br>
{% endfor %}
Plugin Author
berkux
(@berkux)