Skip to content

Main content

Loyalty Expiry Rounding Credit Tool

Expose signed credit from an explicitly supplied upward/downward expiry quantum rule.

Loading tool…

Description

Round points up or down to a multiple of positive integer quantum for roundedExpiry.

Rounding to a quantum chooses a representable multiple. Upward, downward, half-even, and away-from-zero policies differ at boundaries and can change signed residuals.

Round points up or down to a multiple of positive integer quantum for roundedExpiry.

When to use this tool

Use Loyalty Expiry Rounding Credit when you need a rounding result under an explicit policy.

How to use the tool and how it works

  1. Enter points, quantum, roundUp. 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 roundedExpiry, retained. Use the output convention below.

Round points up or down to a multiple of positive integer quantum for roundedExpiry. Return points minus that rounded amount as retained.1

Input fieldMeaning and unitsAccepted input
pointsPointsRequired. Safe integer; minimum 0.
quantumQuantumRequired. Safe integer; minimum 1.
roundUpRound UpRequired. Boolean.
Output fieldInterpretationReturned shape
roundedExpiryRounded ExpiryRequired. Safe integer.
retainedPoints minus roundedExpiry; can be negative under round-up policy.Required. Safe integer.
json
{
  "input": {
    "points": 103,
    "quantum": 10,
    "roundUp": false
  },
  "output": {
    "roundedExpiry": 100,
    "retained": 3
  }
}

Limitations and assumptions

  • Rounding up can make retained negative; the tool reports the arithmetic rather than enforcing a loyalty balance policy.
  • 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 decimal or exact arithmetic when contractual decimal ties or currency rules require it.

References

  1. Calculation and input contract: marketing/loyalty-expiry-rounding-credit — tool.io

Similar or alternative tools