Skip to content

Main content

Basket Discount Base Exclusion Tool

Calculate basket discount base exclusion from explicit caller-supplied inputs.

Loading tool…

Description

Apply a discount to nonexcluded basket items.

Consumer-study records can describe exposure, recall, option availability and purchase-value bases. Local record arithmetic preserves a supplied study or billing convention without measuring preferences, establishing memory accuracy or determining consumer rights.

Apply a discount to nonexcluded basket items.

When to use this tool

Use Basket Discount Base Exclusion when checking a supplied consumer-record, recall-window, choice or basket convention.

How to use the tool and how it works

  1. Enter itemValues, excluded, discountFraction. Keep parallel arrays aligned. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read base, discount, total. Use the output convention below.

Apply a discount to nonexcluded basket items. Require aligned nonnegative itemValues/excluded and discountFraction in [0,1]; base sums nonexcluded values, discount = base*fraction, total = all values-discount.1

Input fieldMeaning and unitsAccepted input
itemValuesItem ValuesRequired. Array of finite number; maximum items 256.
excludedExcludedRequired. Array of boolean; maximum items 256.
discountFractionDiscount Fraction Unit: 1.Required. Finite number; minimum 0; maximum 1.
Output fieldInterpretationReturned shape
baseBaseRequired. Finite number.
discountDiscountRequired. Finite number.
totalTotalRequired. Finite number.
json
{
  "input": {
    "itemValues": [
      20,
      30
    ],
    "excluded": [
      false,
      true
    ],
    "discountFraction": 0.1
  },
  "output": {
    "base": 20,
    "discount": 2,
    "total": 48
  }
}

Limitations and assumptions

  • Eligibility, tax basis and actual merchant policy are supplied rather than verified.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use actual study data, validated measurement methods and applicable merchant/consumer rules for substantive behavioral or transaction conclusions.

References

  1. Calculation and input contract: consumer-behavior/basket-discount-base-exclusion — tool.io

Similar or alternative tools