A storage unit rents for $150.02. The example lease asks for a $32.50 late fee. Under a modeled $20-or-20% policy, the permitted fee in the calculation is $30.00. Two payments and a separate $5 charge leave $85.02 to cure.

Effective date Posting Change Balance
Oct 31 Rent +$150.02 $150.02
Nov 5 First payment -$50.01 $100.01
Nov 6 Late fee +$30.00 $130.01
Nov 7 Separate charge +$5.00 $135.01
Nov 8 Second payment -$49.99 $85.02

Give the fee a cutoff and a basis

The calculation takes the greater of the flat amount and the percentage of contractual monthly rent. It rounds the percentage component down to cents so the modeled limit never exceeds the computed percentage by a fraction of a cent. The lease fee can be lower than that limit. The Florida and Washington presets represent their statutory reasonableness safe harbors. Florida Statutes § 83.808(3) · RCW 19.150.150

The due date is day zero. With five grace days, an Oct 31 bill can be paid through Nov 5 without a fee. A balance of one cent of unpaid rent when Nov 6 starts still triggers the modeled fee. Payment that day reduces the cure amount after fee assessment. The ledger applies payments to older debt before this month's rent, so it tracks current unpaid rent and the total cure balance separately.

Anchor the auction to the actual notice and ads

In the example timeline, Nov 13 is the first day the notice can become effective. With a 14-day cure period and a one-day publication delay, Nov 28 is the first ad date. A second ad seven days later lands on Dec 5. The later of the two modeled auction waits yields Dec 13.

If the notice actually takes effect Nov 15 and the first ad runs Dec 1, the same policy moves the projected second ad to Dec 8 and the auction to Dec 16. The calendar adds whole civil days across the daylight-saving change. The benchmark uses illustrative offsets. For a facility, enter the applicable waiting periods and the actual date of the event that starts the notice clock.

Run the benchmark

Run this block from the library checkout with Node.js 20 or later. It checks the exact fee, as-of balance, and auction date before warming up each case. The 128-posting case adds a ledger replay workload. MIT source repository

node --input-type=module <<'JS' import assert from 'node:assert/strict'; import { performance } from 'node:perf_hooks'; import { calculateDelinquency } from './src/index.js'; const payment = (id, date, amountCents) => ({ id, date, kind: 'payment', amountCents }); const charge = (id, date, amountCents) => ({ id, date, kind: 'charge', amountCents }); const policy = { defaultDaysAfterDue: 6, overlockDaysAfterDefault: 1, noticeDaysAfterDefault: 7, noticeCureDays: 14, advertisementDaysAfterCure: 1, advertisementCount: 2, advertisementIntervalDays: 7, auctionDaysAfterFirstAdvertisement: 15, auctionDaysAfterLastAdvertisement: 3, }; const partial = { state: 'FL', dueDate: '2026-10-31', asOfDate: '2026-11-08', monthlyRentCents: 15_002, graceDays: 5, requestedLateFeeCents: 3_250, timeline: { policy }, entries: [ payment('P1', '2026-11-05', 5_001), charge('F1', '2026-11-07', 500), payment('P2', '2026-11-08', 4_999), ], }; const grace = { ...partial, entries: [payment('P1', '2026-11-05', 15_002)], }; const lateNotice = { ...partial, timeline: { policy, noticeEffectiveDate: '2026-11-15', firstAdvertisementDate: '2026-12-01' }, }; const larger = { ...partial, entries: Array.from({ length: 128 }, (_, index) => charge('C' + index, '2026-11-07', 1)), }; const fixtures = [ ['Last grace day payment', grace, 0, 0, '2026-12-13', 10_000], ['Partial payments + delayed notice/ad', lateNotice, 8_502, 3_000, '2026-12-16', 10_000], ['128 posted charges', larger, 18_130, 3_000, '2026-12-13', 2_000], ]; assert.deepEqual(calculateDelinquency(partial).ledger.map((row) => row.balanceCents), [15_002, 10_001, 13_001, 13_501, 8_502]); const measurements = []; for (const [fixture, input, balance, fee, auction, iterations] of fixtures) { const result = calculateDelinquency(input); assert.equal(result.balanceCents, balance); assert.equal(result.cureAmountCents, balance); assert.equal(result.assessedFeeCents, fee); assert.equal(result.firstLateFeeDate, '2026-11-06'); assert.equal(result.timeline.earliestAuctionDate, auction); for (let i = 0; i < 500; i++) calculateDelinquency(input); const samples = []; for (let round = 0; round < 5; round++) { let checksum = 0; const start = performance.now(); for (let i = 0; i < iterations; i++) { const run = calculateDelinquency(input); checksum += run.balanceCents + run.ledger.length; } samples.push(performance.now() - start); assert.equal(checksum, (balance + result.ledger.length) * iterations); } const median = samples.sort((a, b) => a - b)[2]; measurements.push({ fixture, iterations, medianMs: Number(median.toFixed(2)), callsPerSecond: Math.round(1000 * iterations / median) }); } console.log(process.version, process.platform, process.arch); console.table(measurements); JS 

One run on macOS arm64 with Node.js v24.14.1 produced these medians across five samples.

Fixture Calls per sample Median Calls per second
Last grace day payment 10,000 70.96 ms 140,925
Partial payments + delayed notice/ad 10,000 99.40 ms 100,608
128 posted charges 2,000 216.46 ms 9,240

The complete call validates dates and entries, sorts the postings, then builds the ledger rows and calendar projection. Timing covers the calculation and result objects. It excludes browser rendering and file I/O.

Change the payment date or first ad date in the GitHub Pages demo. Related tools include StorageDelinqPack and RentLedgerPack.