divide

Returns the value split by the given number, which is an average from a total and a count, or a share from an amount and a number of people.

Dividing by zero is an error rather than an infinity. A count that came out zero is an empty collection, and a template that printed "+Inf" over it would be reporting the absence of data as a result.

InputArgumentsReturnsanyanyfloat64
Source
BasicSource

Averages a total over a count.

Given

{"total": 1250, "orders": 8}

Template

{{ total | divide:orders | decimal:2 }}

Result

156.25