Power Automate (WDL) function
mul / div — Power Automate (WDL) function reference
Multiply or divide.
Syntax
wdl
mul(multiplicand1, multiplicand2) / div(dividend, divisor)
Examples
wdl
div(variables('total'), 2)→ A number
wdl
mul(item()?['UnitPrice'], item()?['Quantity'])
→ A line total
wdl
div(float(variables('completed')), float(variables('totalTasks')))→ A completion ratio between 0 and 1
Common mistakes & gotchas
- div of two integers does integer division — wrap an argument in float() for decimals.
- div() of two integers truncates toward zero (integer division) rather than returning a decimal — div(7, 2) is 3, not 3.5; wrap an argument in float() to get a real quotient.
- Dividing by zero throws "division by zero" at runtime rather than returning infinity or null — guard the divisor with an equals(..., 0) check first.
Related Workflow Definition Language functions
From Math