Skip to content

bmel:to-number

Category: Type Conversion · Returns: bmel:number

Signature
bmel:to-number(expr: bmel:any)

Description

Converts the expression to a numeric value. For strings, parses the text representation of the number (e.g. '42', '3.14'). For booleans, true evaluates to 1 and false evaluates to 0. Numbers are returned as-is.

Arguments

Parameter Type Required Description
expr bmel:any The value to convert to a number. Accepts string, boolean, or number.

Examples

Number from a numeric string
bmel:to-number({createOrder:Request Payload}.$.quantity)
Amount sent as text, with tax
bmel:to-number({createOrder:Request Payload}.$.amount_text) * 1.21

← Back to BMEL Reference