Dividir cuenta con propina
bill-splitDivide una cuenta entre personas con propina opcional y redondeo de cada parte. Cuándo: un cálculo de dinero, impuestos o matemática financiera tiene que ser exacto y reproducible (redondeo, centavos, tasas). No para: dividir un monto en partes que suman exactamente el total (money-allocate). Efectos secundarios: ninguno (solo lectura, sin red, sin estado guardado). Determinista: la misma entrada da la misma salida. Límites: entrada JSON de hasta 64 KB, 1 s por llamada, resultado de hasta 1 MB.
EN: Splits a bill among people with an optional tip % (on pre-tax or total) and rounding up of each share, keeping the shares summing to the total charged. When: a money, tax or financial-math result has to be exact and reproducible (rounding, cents, rates). Not for: splitting an amount into parts that add up exactly (money-allocate). Side effects: none (read-only, no network access, no stored state). Deterministic: the same input gives the same output. Limits: JSON input up to 64 KB, 1 s per call, result up to 1 MB.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| total | Yes | Bill total (number; required; min 0; max 1000000000000). | |
| people | Yes | People (integer; required; min 1; max 1000). | |
| currency | No | ISO 4217 currency code (string; optional; default "USD"; pattern ^[A-Za-z]{3}$). | USD |
| tip_base | No | Amount the tip is computed on (default total) (number; optional; min 0). | |
| round_up_to | No | Round each share up to a multiple of this (e.g. 1000 COP) (number; optional; > 0). | |
| tip_percent | No | Tip % (number; optional; default 0; min 0; max 100). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tip | No | ||
| surplus | No | ||
| collected | No | ||
| per_person | No | ||
| grand_total | No |