Canton dApp Booster
    Preparing search index...
    • Reduces raw field input to a decimal: grouping separators and anything that can never belong to an amount are dropped rather than flagged, so a paste of 1,234.5 lands as 1234.5. A sign or an exponent is kept instead of stripped, so -5 and 1.5e3 reach validateAmount as not-a-number rather than being salvaged into an amount nobody entered.

      The inverse of formatAmount, and it must be passed the same locale: under a comma-decimal locale a mismatched pair reads a value a thousand times too small.

      Parameters

      • input: string
      • Optionallocale: string

      Returns string

      sanitizeAmountInput('.5') // '0.5'