Number rounding tool
3.14159 rounded to two decimal places is 3.14, and an exact half always moves away from zero, so 2.5 becomes 3 and -2.5 becomes -3. Round to decimals or to tens, hundreds and thousands for tables and reports. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- Number to round
- 3.14159
- Places
- 2
- Rounded
- 3.14
- Calculation mode
- decimal
A number rounding tool turns a raw measurement, price, or statistic into a cleaner value at the scale you choose. You can keep two decimal places for currency-style display, drop fractions entirely for whole counts, or snap a figure to the nearest ten, hundred, or thousand when tables and dashboards only need order-of-magnitude precision. This capability accepts a finite number, an optional places count from zero through fifteen, and an optional nearest mode for decimal, ten, hundred, or thousand. It applies a deterministic half-away-from-zero rule so positive and negative half-cases move away from zero in a predictable way, then returns the cleaned original value, the rounded result, the active mode, the places used for decimal mode, and the step size for scale modes. Non-numeric text, empty strings, NaN, and Infinity are rejected with a clear validation error instead of silent coercion.
How the rounding algorithm works
Start with a finite real number and decide the target scale. In decimal mode the places parameter is an integer from zero to fifteen and means how many digits remain after the decimal point: places zero yields the nearest integer, places two is the classic currency-style round, and higher places preserve more fractional detail for scientific display. Internally the solver multiplies by ten to the power of places, applies half-away-from-zero integer rounding, then divides by the same factor so the result lands on a clean decimal grid.
Half-away-from-zero means that when the fractional part to discard is exactly one half, the absolute value grows: two point five with places zero becomes three, and negative two point five becomes negative three. That rule is symmetric for sign, easy to explain in documentation, and free of banker's-round surprises that alternate on even and odd integers.
When nearest is ten, hundred, or thousand, places is ignored and the value is divided by the corresponding step, rounded with the same half-away-from-zero integer step, then multiplied back so one thousand two hundred thirty-four nearest hundred becomes one thousand two hundred.
What you send and what you get back
Send a finite number under the field value. Optionally send places as an integer from zero to fifteen; when omitted it defaults to zero so a bare value rounds to the nearest integer. Optionally send nearest as decimal, ten, hundred, or thousand; when omitted the mode is decimal and places applies.
Typical checks include three point one four one five nine with places two yielding three point one four, one thousand two hundred thirty-four with nearest hundred yielding one thousand two hundred, and negative two point five with places zero yielding negative three. Wire the free browser form for homework, quick UI previews, and spreadsheet sanity checks, then call the identical contract from scripts when you need bulk normalization of metrics before storage or charting.
Where number rounding shows up in real work
Finance and commerce pipelines round unit prices, tax lines, and invoice totals to two decimal places before display and before settlement so UI labels and ledger rows share one number. Analytics dashboards often snap visitor counts, inventory units, and large currency aggregates to the nearest ten, hundred, or thousand so axis ticks and summary cards stay readable without false precision. Classroom and exam settings need a single trusted oracle for half-cases and negative values so answer keys and student calculators do not diverge on two point five versus banker's round.
Data engineers normalize sensor readings and CSV imports to a fixed places count before hashing or comparing rows, cutting flaky equality checks caused by long binary tails. If you later need decimal-to-percent conversion, fraction-to-decimal expansion, locale-aware number formatting, or significant-figure scientific notation as a separate product surface, treat those as distinct search intents and landings rather than overloading this number rounding tool page.
What you can do with it
Currency and invoice line totals
Round prices and tax lines to two decimal places with a documented half-away-from-zero rule before display or settlement.
Dashboard axis and summary cards
Snap large counts to the nearest ten, hundred, or thousand so charts and KPI cards stay readable without false precision.
Homework and bulk data cleanup
Normalize homework keys and CSV sensor columns to a fixed places count so graders and pipelines share one ground truth.
FAQ
What rounding rule does this tool use?
Half away from zero: when the discarded part is exactly one half, the absolute value increases. So 2.5 with places 0 becomes 3, and −2.5 becomes −3.
How do I round to the nearest hundred?
Places is ignored in that mode. Example: value 1234 nearest hundred returns 1200.
What happens with non-numeric input?
Bare text, empty strings, NaN, and Infinity are rejected and are not charged.
What is the range for places?
An integer from 0 to 15 inclusive. Default is 0 (nearest integer) when nearest is decimal or omitted.
What does it cost?
The browser tool is free and runs locally.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/fmt/rounding \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"value":3.14159}'const res = await fetch("https://api.kit.forhosting.com/fmt/rounding", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"value": 3.14159
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/fmt/rounding",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"value": 3.14159
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/fmt/rounding", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"value":3.14159}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"value":3.14159}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/fmt/rounding", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"value": 3.14159
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "fmt.rounding",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
How the rounding algorithm works
There is no random seed, no wall-clock timestamp, and no network call; identical inputs always produce identical JSON. Missing value, bare words, empty strings, NaN, and Infinity fail with invalid_input and are not charged.
What you send and what you get back
Aliases n, number, input, x, and num are accepted for convenience when wiring forms or scripts. Aliases to, scale, and unit also map to nearest. On success the response echoes the cleaned input value, the rounded result, mode as one of decimal, ten, hundred, or thousand, places as the integer used in decimal mode or null in scale modes, step as ten, one hundred, or one thousand when a scale mode is active or null for decimal mode, and method always set to half_away_from_zero so clients can document the rule without reading source. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance. Rejected requests always use the invalid_input code so clients can branch without parsing free-form five-hundred errors.
Where number rounding shows up in real work
Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.