Room Tally: A Free Boarding House Rent and Sub-Meter Ledger That Splits the Electric Bill Fairly
Most boarding houses near schools have one electric meter from the co-op and a small sub-meter in every room. Each month the owner copies readings into a notebook, divides the bill by hand, splits the water and hallway lights, then chases partial payments while boarders question the math. I built Room Tally, a free web app that does that arithmetic the same way every month and shows each tenant exactly how their bill was made.
It handles per-room and per-bed rent, sub-metered electricity, the common-area share, water, extras, partial payments, carried balances and a late fee, all in pesos and all inside the browser. Nothing is uploaded, there is no server, and it works on a phone so a caretaker can collect door to door.
Try It: Split This Month's Electric Bill
This is a slice of the real billing engine with three rooms from the sample boarding house. Change the main bill or any room's current sub-meter reading and every share updates. Type a reading lower than last month to see the warning, then open the reminder for Grace in Room 5.
Room Tally in Pictures
Real screenshots of the working app with the sample boarding house loaded.
Sample 1: The Overview screen: totals for October, who still owes, and every room with its sub-meter reading.
Sample 2: Meter readings in dark mode: type a current reading and the room's electricity cost updates at once.
Sample 3: A bill reminder with rent, kWh, water, the carried balance and the due date, ready for SMS or Messenger.
Sample 4: The same ledger on a phone, so a caretaker can collect rent door to door.
Build Footprint & Quality Checks
Landlords open this on budget phones, so I kept it small and framework-free. These are the measured numbers from the v1.0.0 build:
Technology Stack & Languages Used
Vanilla JavaScript
A pure billing engine that runs in the browser and in Node, plus the screens, forms and delegated events. No framework.
CSS Custom Properties
Design tokens for light and dark themes, CSS grid layouts that fold to a phone tab bar, and odometer-style meter dials.
Semantic HTML5
One page with landmarks, a skip link, labelled tabs and form fields. GitHub Pages serves it as-is.
localStorage + Node assert
Data stays on the device with JSON backup and CSV export. 19 Node tests cover splits, carry-over, late fees and reading checks.
Key Architectural Decisions
Money in Centavos
Every peso amount becomes a whole number of centavos, and splits use the largest-remainder method, so ₱100 for three people is 33.34 + 33.33 + 33.33 and never ₱99.99.
Bills Are Calculated, Not Stored
Only the inputs are saved: rooms, tenants, readings and payments. Bills are rebuilt from them each time, so fixing one reading corrects every share and every carried balance.
Pure Engine, Thin UI
billing.js has no DOM code, so the same functions run in the browser and in the Node test suite. The screens only render its results.
Private and Offline
No account and no server: data lives in the browser with try/catch around storage, user text is escaped before rendering, and backups are checked before import.
Exact Splits, Carried Balances & New Months
Three real excerpts from the source: the centavo helpers and rate, the carry-forward loop, and how a new month opens.
// assets/js/billing.js — exact pesos
/** Pesos (number or string) -> integer centavos. */
function toCents(value) {
var n = typeof value === 'string' ? parseFloat(value.replace(/[^0-9.\-]/g, '')) : Number(value);
if (!isFinite(n)) return 0;
return Math.round(n * 100);
}
/**
* Split an amount (centavos) into n parts that add up exactly.
* The leftover centavos go to the first parts (largest-remainder method).
*/
function splitEven(cents, n) {
if (!n || n < 1) return [];
var base = Math.floor(cents / n);
var rest = cents - base * n;
var out = [];
for (var i = 0; i < n; i++) out.push(base + (i < rest ? 1 : 0));
return out;
}
/**
* Electricity rate for a month in centavos per kWh (kept as a float for precision).
* mode "auto": main bill amount / main bill kWh. mode "fixed": settings.fixedRate.
*/
function ratePerKwh(settings, month) {
if (settings.rateMode === 'fixed') return toCents(settings.fixedRate || 0);
var kwh = Number(month && month.mainKwh) || 0;
var amt = toCents(month && month.mainAmount);
return kwh > 0 ? amt / kwh : 0;
}
// assets/js/billing.js — balances move to next month
/**
* Compute a month including balances carried from every earlier month in the data.
* Unpaid balances move forward; overpayments become a credit (negative carry).
*/
function computeWithCarry(data, key, today) {
var keys = Object.keys(data.months || {}).filter(function (k) { return k < key; }).sort();
var carry = {};
keys.forEach(function (k) {
var r = computeMonth(data, k, today, carry);
var next = {};
r.bills.forEach(function (b) { if (b.balance !== 0) next[b.tenant.id] = b.balance; });
carry = next;
});
return computeMonth(data, key, today, carry);
}
// assets/js/store.js — opening a new month
/** Start a new month: previous readings = last month's current readings. */
function startMonth(d, key, fromKey) {
if (d.months[key]) return d.months[key];
var from = d.months[fromKey] || {};
var readings = {};
d.rooms.forEach(function (r) {
var last = (from.readings || {})[r.id];
readings[r.id] = { prev: last ? Number(last.curr) || 0 : 0, curr: '' };
});
d.months[key] = { mainKwh: '', mainAmount: '', waterBill: from.waterBill || '', readings: readings, extras: [], payments: [] };
return d.months[key];
}
# Run the tests (Node.js, no npm install)
$ node tests/billing.test.js
Room Tally billing tests
ok splitEven keeps every centavo (₱100.00 / 3)
...
19 tests passed
Development Roadmap & Milestones
Version 1.0.0 is released. The next milestones come from the project roadmap:
v1.0.0: Core Ledger (Released)
Sub-metered electricity, common-area and water splits, per-room and per-bed rent, payments, carried balances, late fee, reminders, JSON backup and CSV export.
Next: Printable Statements & Deposits
A print-friendly monthly statement per tenant and a deposits and advance-payment ledger.
Planned: Optional Sheets Sync
Opt-in sync to Google Sheets through Apps Script, so an owner and a caretaker can share one ledger.
Planned: Tenant View
A read-only share link where each boarder sees their own bill breakdown and payment history.
User Interface & Feature Showcase
Project Links, Code & Documentation
Open the Live App
Runs in your browser with the sample boarding house loaded. Start your own ledger from Settings when you are ready.
GitHub Repository
Browse the source, download the v1.0.0 release, or open an issue. Free and open source under the MIT license.
How It Was Built
The build log lists the languages used, every step, the test results and the problems fixed along the way.
Fair Bills Make Fewer Arguments
Splitting one electric bill across a dozen boarders sounds like simple division until you add sub-meters, hallway lights, water, partial payments and last month's balance. Room Tally keeps every centavo accounted for and shows the work. Want it set up for your boarding house or dorm, or a custom version with cloud sync?
Frequently Asked Questions
Is Room Tally free to use?
Yes. Room Tally is open source under the MIT license, so you can use it for your own boarding house, change it, or set it up for clients without paying anything.
Do I need WordPress, Blogger or special hosting to run it?
No. Room Tally is a standalone web app, not a WordPress plugin. Open index.html in a browser, or upload the folder to GitHub Pages, Netlify or any shared hosting.
What do I need to use it?
A modern browser such as Chrome, Edge, Firefox or Safari on a computer or phone. There is nothing to install and no coding needed; Node.js is only required if you want to run the automated tests.
Is my tenants' data uploaded anywhere?
No. Rooms, tenants, readings and payments are saved only in your browser on that device. Use the JSON backup in Settings to keep a copy or move it to another device.
How does it split the electric bill when every room has a sub-meter?
It divides the main bill amount by the main meter kWh to get the rate, charges each room its own kWh times that rate, and splits it among the people in the room. The leftover kWh for hallways, kitchen and pump is shared equally by all tenants, and all math is done in centavos so the parts always add up.
Can you set this up for my business website?
Yes. I can set up Room Tally for your boarding house, dorm or apartment, rebrand it with your name and colours, load your rooms and tenants, and host it on your own domain. Contact me here.
The boarding house, tenants, readings and amounts in the demo are invented sample data. Room Tally is a record-keeping aid and does not issue official receipts.





Comments
Post a Comment