@playlive/fundraiser-data
    Preparing search index...

    Function getDonorLevel

    • Bucket a donation amount into a DonorLevel. Truncates (Math.trunc) before comparison so 24.99 → grey, matching the historical Number.parseFloat → truncation flow. Accepts strings (Tiltify's amount.value is always a decimal string on the wire) or numbers.

      Parameters

      • amount: string | number

      Returns DonorLevel

      getDonorLevel("100")   // "platinum"
      getDonorLevel(74.99) // "silver" (24.99 above bronze, below gold)
      getDonorLevel("n/a") // "grey" (unparseable → floor bucket)