Notes › Life Essays › One Principal Through Two Formula Paths: 18.23 Apart Over 24 Months and 20.00 From the 365/360 Day Base

One Principal Through Two Formula Paths: 18.23 Apart Over 24 Months and 20.00 From the 365/360 Day Base

Two formula paths measured on one page: simple interest and auto-rollover compound differ by 18.23 for a principal of 100000 at rate 1.35 over 24 months; 365 demand days versus 12 fixed months differ by 20.00 at 80000 and rate 1.8. Both gaps sit on the formulas and the 365/360 day-count base.

Draw the boundary first: every number on this page comes out of three formulas

This page ships no built-in rate table and fires no upload request; changing any input recomputes the whole block from scratch. Loading the template's <script> block into Node and running it exactly as written (measured 6636 bytes) confirms that every displayed value travels one of three formulas and nothing else: fixed-term simple interest "interest = principal × annual rate × months held ÷ 12", auto-rollover compound "principal plus interest = principal × (1 + annual rate)^years", and demand deposit "interest = principal × annual rate × days ÷ 360". The literal 360 appears 5 times in the script section, while a branch that folds a year with 365 or with an actual day count simply does not exist in the code. Everything below keeps score only on formula paths and rounding behaviour, and every input used as a sample is a fictional value rather than a quotation from any product.

Simple interest versus rollover compound: which formula produces the gap

With principal 100000, annual rate 1.35 and a term of 12 months the exponent equals 1, the compound formula collapses into the simple one, and both rows of the comparison card display 1350.00 and 101350.00; only a term of 24 months forces the two paths apart. Four whole-year inputs listed side by side:

Input (principal / annual rate / term / mode)Simple-interest displayCompound displayHow the page presents it
100000 / 1.35 / 12 months / renew1350.001350.00Exponent is 1, both rows identical
100000 / 1.35 / 24 months / renew2700.002718.23Stats bar computes "compound exceeds simple by 18.23 yuan"
50000 / 2.5 / 36 months / fixed3750.003844.53Comparison table lists both, page computes no gap
1000 / 2 / 1200 months / fixed2000.006244.65The two displayed values differ by 4244.65

The gap is never an extra item the page adds by hand: the rollover count has no parameter of its own, count equals years equals exponent, term=24 rolls one time and term=1200 rolls 99 times, and interest joining the next period happens entirely inside (1 + annual rate)^years with no period-by-period table anywhere on the page. When the term is not a multiple of 12 the comparison card disappears altogether — entering term=18 prints only the simple-interest line 2025.00 (a monthly average of 112.50), because the second card has nothing to render against. Every figure in this block can be reproduced as is on the deposit interest calculator page.

Simple P×r×months÷12: 100000×1.35%×24÷12 = 2700.00 Compound P×(1+r)^years: 100000×1.0135^2 = 102718.23 Interest 2718.23 = total 102718.23 − principal 100000 Gap 18.23 = 2718.23 − 2700.00 (the exponent term)

Figure 1: the two output paths over 24 months; the 18.23 gap sits strictly between the two displayed rows.

Demand deposit by day: the 20.00 gap is the 365/360 day base, not a calendar

Inputs principal 80000 and annual rate 1.8, and the three ways of filling the fields display as follows:

  • demand mode with days=365: 80000 × 1.8% × 365 ÷ 360 = 1460.00;
  • demand mode with days=360: the same formula returns 1440.00;
  • fixed mode with term=12: 80000 × 1.8% × 12 ÷ 12 = 1440.00.

The 20.00 that 365 days shows on top of 12 months comes entirely from the 365/360≈1.0139 day-folding base, and not from any real calendar difference: the daily rate is permanently the annual rate ÷ 360, there is no calendar and no start or end date anywhere in the code, the day count is typed by hand, and the page never checks it against anything. Entering 1.35 makes the stats bar print a daily rate of 0.003750% (1.35 ÷ 360 × 100, the only toFixed(6) call on the whole page). Because the calendar is missing, January through March (31+28+31=90 days) and April through June (30+31+30=91 days) both return the identical 337.50 as soon as days=90 is typed (principal 100000, annual rate 1.35, a daily average of 3.75 yuan), and the wording about counting the first day but not the last one is only text printed beside the fields.

Demand 365 days: 80000×1.8%×365÷360 = 1460.00 Demand 360 days: 80000×1.8%×360÷360 = 1440.00 Fixed 12 months: 80000×1.8%×12÷12 = 1440.00 Gap 20.00 from the 365/360 base; the page has no calendar

Figure 2: three rows of displayed values for one and the same input; the 20.00 gap lands only on the divisor convention.

Rounding to cents and silent truncation: two precisions for a single value

Every money field goes through the native toFixed(2) (20 call sites in the script section), so behaviour at an x.xx5 boundary follows whatever the binary mantissa happens to be: with P=1, R=6 and term=1 the raw value 0.00500000000000000010408 rounds up and displays 0.01, while the stored form of 2.675 is 2.67499999999999982236, so the very same mechanism drops it to 2.67. For the 24-month set the raw principal-plus-interest value is 102718.225000000005821, its tail sits just above the half cent, and the page therefore prints 102718.23 rather than the lower cent.

The term and the day count instead go through parseInt, so any decimal is truncated in silence: 12.9 is computed as 12, and with principal 10000 and annual rate 2.4 the page shows 240.00 while the stats bar writes "12 months (1.00 year)"; 90.9 is computed as 90, and with principal 10000 and annual rate 1.8 the page shows 45.00. The same page also forks on precision: with term 7 the formula line prints 7 ÷ 12 = 0.5833333333333334 exactly as the division came out, while the stats bar renders that identical quantity as 0.58, two statements about one number at two different precisions. Another rounding path for displayed decimal places is documented on the decimal place formatter page, and this note keeps to what the deposit page itself does.

Fault tolerance: silent fallback throughout, one explicit error on the whole page

The guard is a single line, if (!(P > 0) || !(R >= 0)): an empty, abc, 0 or negative principal, a negative or non-numeric rate, or a term or day count that is not greater than zero all fall back quietly to the empty state that reads "values recalculate automatically once you fill the parameters, no button needed"; a rate of 0 is a legal input instead of an error, and principal 1000, annual rate 0, term 12 returns interest 0.00 and a total of 1000.00. There is no upper bound either: annual rate 5000 with principal 1000 and term 12 computes 50000.00 without a single warning. The only explicit error appears when the mode is renew and the term is not a multiple of 12: with term=15 the result area is hidden and the red line reads, word for word, "auto rollover compounds by whole years, so the term must be a multiple of 12 (12, 24, 36); for a partial year use the fixed-term formula as an estimate". The large-denomination certificate listed alongside the tool introduction has no branch in the code at all, and the dropdown offers only fixed, renew and demand. A failing path never clears what was already rendered: after the first screen prints 1350.00, changing the principal to abc leaves the main value at 1350.00 with only its container hidden, and the clear control touches just the principal and rate fields, leaving 24 in the term box and 90 in the day box.

Three reconciliation questions people ask about this page

Q: Is the 20.00 that 365 days adds over 12 months a real calendar difference?

No. It is only the 365/360 day-base difference: the daily rate is permanently the annual rate ÷ 360, so putting 365 into the numerator lands one step above what the ÷12 fixed-term path returns, by a factor of 365/360≈1.0139, and the page performs no calendar conversion of any kind.

Q: Will a term of 12.9 or a day count of 90.9 raise an error?

Neither one does. parseInt cuts them to 12 and 90 before they ever reach the formula, which is why the corresponding displays read 240.00 and 45.00, and no hint text is produced along the way.

Q: Does the rollover compound path print a period-by-period interest table?

It does not. The count equals the years equals the exponent, so 100000 × (1 + 1.35%)^2 returns 102718.23 in one line, and the calculation process card holds only that single expression. The companion account for percentage base asymmetry is laid out in that earlier note, and this page repeats none of its numbers.

📎 Related articles

The Equivalent Decimal Column Stays 15 Characters Long: Reconciling Every Output Column of the Reduce-Fraction Page 2026-11-24 When "Must Carry" Meets an Operand Cap of 5: 0 of 40 Problems Carry, 17 Contain a Zero Addend 2026-11-23 Names Already Drawn Can Win Again Next Round: Spread 118 Over 10000 Draws and a Pool That Never Empties 2026-11-23 Weigh the color distance before swapping the background: at tolerance 52 the red shift replaces 0.7296, the green shift only 0.2458 2026-11-21 Padding accounting in long-image concat: left and right stay 0 at 100px, canvas dual thresholds 32767 and 268435456 2026-11-21