Redondear número
round-numberRedondea a N decimales con aritmética decimal exacta y modos half_up, half_even (bancario), up, down, ceiling, floor. Cuándo: un resultado numérico tiene que ser exacto o reproducible y no estimado. No para: redondear un número a N cifras significativas, en notación normal y científica (significant-figures). 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: Rounds a number to N decimal places using exact decimal arithmetic (no float drift: 1.005 → 1.01 half-up) with modes half_up, half_even (banker's), half_down, up, down, ceiling, floor. When: a numeric result has to be exact or reproducible instead of estimated. Not for: rounding a number to N significant figures and returning it in plain and scientific notation (significant-figures). Side effects: none (read-only, no network access, no stored state). [EN completo / full EN: inputSchema.description]
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Rounding mode (optional; one of: half_up, half_even, half_down, up, down, ceiling, floor; default "half_up"). | half_up |
| value | Yes | Number, or decimal string for exact input (number or string; required; up to 400 chars). | |
| decimals | No | Decimal places (negative rounds to tens, hundreds…) (integer; optional; default 0; min -20; max 20). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | ||
| result | No | any JSON value |