Split a bill
calc_split_billSplit a restaurant bill with tax, service, and tip into exact whole-cent shares that always add up. Supports even or itemized splits, proportional tax/tip, and rounding each share up.
Instructions
Split a restaurant bill with tax/service and tip, in whole cents so the shares always add up exactly (left-over cents go to the largest remainders). simple: one bill split evenly between N people (1–100). items: list who had what; each item is split between the people who shared it (nobody listed = everyone), and tax and tip are shared in proportion. Tip can be on the subtotal or on subtotal + tax; each share can be rounded up to a step (e.g. 0.5 or 1). Returns a ready-to-send summary. Web version: https://s3eidat.github.io/split-bill/
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bill | No | simple: the bill subtotal (before tax and tip). | |
| mode | No | Even split, or itemised. | simple |
| items | No | items: what was ordered. | |
| people | No | simple: how many people (default 2). items: the names, e.g. ["Sara", "Omar", "Lina"]. | |
| currency | No | Currency, e.g. "JOD" (written after) or "$" (written before). | |
| tipOnTax | No | Calculate the tip on subtotal + tax. | |
| roundUpTo | No | Round each share up to a multiple of this (e.g. 0.5, 1, 5). 0 = exact. | |
| taxPercent | No | Tax / service charge percent. | |
| tipPercent | No | Tip percent (default 10). |