Handlebar Helper Function: Multiply

Multiplies two numeric arguments and returns their product. The function can handle both integers and floating-point numbers, and attempts to convert strings to numbers.

ParameterTypeDescription
value1number or stringRequired. The first value to multiply. Must be a number or convertible to a number.
value2number or stringRequired. The second value to multiply. Must be a number or convertible to a number.

The function returns the arithmetic product of the two input values. If you provide more than two arguments, the operation multiplies only the first two. The result is always a number rounded to 2 decimal places.

If either input is a string, the operation tries to convert it to a number. If a string value can’t be converted to a number, the operation throws an exception.