feat: add repayment discounts and interactive net worth trends

Support positive repayment discounts and negative surcharges with exact decimal conversion. Add independent trend toggles, pointer and keyboard date inspection, tests and Chinese documentation.
This commit is contained in:
陈煜 committed 2026-10-04 22:25:32 +08:00
1 parent 096f1577c2
commit b2c22ca050
16 files changed
+505 -84

No files matched your search

+9
View File
@@ -1,3 +1,4 @@
import { repaymentFee } from '../src/repayment';
import { test } from 'node:test';
import assert from 'node:assert/strict';
import {
@@ -76,3 +77,11 @@ test('daily badges expire and filters combine month and day without mutating mar
);
assert.equal(p.lastBookedDate, '2026-10-04');
});
test('repayment discount uses opposite fee sign without decimal precision loss', () => {
assert.equal(repaymentFee('5.87654321'), '-5.87654321');
assert.equal(repaymentFee('-1.86420975'), '1.86420975');
assert.equal(repaymentFee('-0.00000000'), '0');
assert.equal(repaymentFee('0'), '0');
assert.throws(() => repaymentFee('1e3'));
});