@tmlmt/cooklang-parser / formatQuantity
Function: formatQuantity()
formatQuantity(
quantity):string
Format a quantity (fixed value or range) to a string.
Parameters
quantity
The quantity to format
Returns
string
The formatted string representation
Example
typescript
formatQuantity({ type: "fixed", value: { type: "decimal", decimal: 100 } }); // "100"
formatQuantity({ type: "range", min: { type: "decimal", decimal: 1 }, max: { type: "decimal", decimal: 2 } }); // "1-2"