Dankoss Docs - v0.1.0
    Preparing search index...

    Function parseQuantity

    • Parses a quantity string to extract the numeric value, unit, and weight status. Acts as a pure utility algorithm for data normalization. *

      Parameters

      • quantity: string

        The raw quantity string (e.g., "1.5 kg", "500 g", "2 packs").

      Returns { baseUnit: string; baseValue: number; isWeight: boolean }

      An object containing the parsed value, standardized unit, and a boolean indicating if it's a weight measurement.