Preparing search index...

    Function extractNumericValue

    • Extracts the first numeric value from a nutrition string. Handles formats like "200 kcal", "15g", "2.5 mg", etc.

      Parameters

      • value: undefined | string

        Nutrition string potentially containing a number

      Returns number

      The extracted number, or 0 if no number found