{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"rounding"},"result":{"entity_type":"calculator","id":"rounding","calculator_id":"rounding","canonical_url":"https://tttkmbb.com/math/rounding","name":"Rounding Calculator","title":"Rounding Calculator – Decimal Places or Significant Figures, Ceiling, Floor and Truncate","category":"math","category_name":"Math","tool_name":"calculate_rounded_value","featured_mcp_tool":false,"description":"Rounds a number to a given number of decimal places (negative for tens, hundreds, …) or significant figures using round-half-away-from-zero, and also reports the ceiling, floor and truncated values at the same precision.","use_when":"You need a number rounded to a fixed number of decimals or significant figures, or its ceiling/floor at that precision, with the exact decimal behaviour (2.675 → 2.68).","do_not_use_when":"You want a number written in scientific or engineering notation (use scientific-notation).","inputs":[{"name":"value","label":"Value","type":"number","required":true,"min":-1000000000000,"max":1000000000000,"description":"The number to round.","example":2.675},{"name":"precision","label":"Precision","type":"integer","required":false,"default":2,"min":-9,"max":12,"description":"Decimal places when mode is decimals (negative rounds to tens, hundreds, …), or the number of significant figures (1–12) when mode is significant_figures.","example":2},{"name":"mode","label":"Mode","type":"enum","required":false,"default":"decimals","values":[{"value":"decimals","label":"Decimal places","aliases":["decimal","places","dp"]},{"value":"significant_figures","label":"Significant figures","aliases":["sig figs","significant","sf"]}],"description":"Whether precision counts decimal places or significant figures.","example":"decimals"}],"outputs":[{"name":"rounded","label":"Rounded","type":"number","decimals":12,"description":"Value rounded half away from zero at the requested precision."},{"name":"rounded_text","label":"Rounded (text)","type":"string","decimals":4,"description":"The rounded value written with the requested number of decimals, e.g. '2.68' or '12300'."},{"name":"ceiling","label":"Ceiling","type":"number","decimals":12,"description":"Smallest value at that precision that is ≥ value."},{"name":"floor","label":"Floor","type":"number","decimals":12,"description":"Largest value at that precision that is ≤ value."},{"name":"truncated","label":"Truncated","type":"number","decimals":12,"description":"Value with the extra digits dropped (rounded toward zero)."},{"name":"decimal_places_used","label":"Decimal places applied","type":"integer","decimals":0,"description":"The decimal-place count actually used (derived from the magnitude in significant-figure mode)."}],"input_schema":{"type":"object","properties":{"value":{"description":"The number to round.","type":"number","minimum":-1000000000000,"maximum":1000000000000,"examples":[2.675]},"precision":{"description":"Decimal places when mode is decimals (negative rounds to tens, hundreds, …), or the number of significant figures (1–12) when mode is significant_figures.","type":"integer","minimum":-9,"maximum":12,"default":2,"examples":[2]},"mode":{"description":"Whether precision counts decimal places or significant figures.","type":"string","enum":["decimals","significant_figures"],"default":"decimals","examples":["decimals"]}},"additionalProperties":false,"required":["value"]},"output_schema":{"type":"object","properties":{"rounded":{"description":"Value rounded half away from zero at the requested precision.","type":"number"},"rounded_text":{"description":"The rounded value written with the requested number of decimals, e.g. '2.68' or '12300'.","type":"string"},"ceiling":{"description":"Smallest value at that precision that is ≥ value.","type":"number"},"floor":{"description":"Largest value at that precision that is ≤ value.","type":"number"},"truncated":{"description":"Value with the extra digits dropped (rounded toward zero).","type":"number"},"decimal_places_used":{"description":"The decimal-place count actually used (derived from the magnitude in significant-figure mode).","type":"integer"}}},"formula":"rounded = round_half_away(value × 10^p) / 10^p, where p = precision (decimals) or p = precision − 1 − ⌊log10|value|⌋ (significant figures); ceiling, floor and truncated use ⌈·⌉, ⌊·⌋ and trunc(·) instead","method":"The decimal shift uses the exact decimal digits of the input, so ties such as 2.675 are recognised as ties and rounded away from zero (2.68) instead of following binary floating-point noise (2.67).","sources":[{"name":"Wikipedia – Rounding","url":"https://en.wikipedia.org/wiki/Rounding","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wikipedia – Significant figures","url":"https://en.wikipedia.org/wiki/Significant_figures","type":"reference","retrieved_at":"2026-09-23"},{"name":"Wolfram MathWorld – Significant Digits","url":"https://mathworld.wolfram.com/SignificantDigits.html","type":"reference","retrieved_at":"2026-09-23"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"2.675 to 2 decimals","inputs":{"value":2.675,"precision":2,"mode":"decimals"},"expected":{"rounded":2.68,"rounded_text":"2.68","ceiling":2.68,"floor":2.67,"truncated":2.67,"decimal_places_used":2},"url":"https://tttkmbb.com/api/v1/calculate/rounding?value=2.675&precision=2&mode=decimals"},{"name":"12345.678 to 3 significant figures","inputs":{"value":12345.678,"precision":3,"mode":"significant_figures"},"expected":{"rounded":12300,"rounded_text":"12300","ceiling":12400,"floor":12300,"truncated":12300,"decimal_places_used":-2},"url":"https://tttkmbb.com/api/v1/calculate/rounding?value=12345.678&precision=3&mode=significant_figures"}],"faq":[{"q":"Which tie-breaking rule is used?","a":"Round half away from zero: 2.5 → 3, −2.5 → −3, 2.675 → 2.68. Spreadsheets use the same rule; Python's round() and IEEE 754 default to round-half-to-even, which gives 2 for 2.5."},{"q":"How do I round to the nearest hundred?","a":"Use mode decimals with precision −2: 12345.678 → 12300."}],"tags":["rounding","round to decimal places","significant figures","ceiling","floor","truncate"],"related":[{"calculator_id":"scientific-notation","reason":"Write the rounded number in scientific or engineering form."},{"calculator_id":"percentage","reason":"Percent results that usually need rounding."}],"links":{"html":"https://tttkmbb.com/math/rounding","markdown":"https://tttkmbb.com/math/rounding.md","json":"https://tttkmbb.com/math/rounding.json","api":"https://tttkmbb.com/api/v1/calculate/rounding","schema":"https://tttkmbb.com/api/v1/calculators/rounding","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:25:00Z","next_actions":[{"tool":"run_calculator","calculator_id":"rounding","reason":"Run Rounding Calculator with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/math/rounding.md"}}