Score:0

twig round function not always working in a Webform

do flag

I have a Webform that makes use of some computed fields.

Here is an example of the computed result:

{% if data.rent_amount and data.rent_period %}
 <span>$
  {{ (data.rent_amount / data.rent_period) *14 |round(2)}}
 </span>
{% else %}
 <span>$0.00</span>
{% endif %}

This works "most" of the time. But sporadically on mobile devices the round(2) function doesn't fire leading to bad-looking results. There are 5 or so computed fields all printed out together so it gets rather confusing to look at.

I have been able to reproduce this intermittently on both Android and Apple devices.

id flag
There isn’t a question here.
do flag
What do you mean? The round function is not being applied sporadically and I can't figure out why. Is it the way I've asked about the issue?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.