All tools · Utilities

Rounding Tool

Round, floor, and ceil to a chosen precision.

Free to use, no sign-up required. Rounding Tool is one of 198 tools built into Xenition, alongside a chat that can use them for you.

Rounds a number to a chosen number of decimal places three ways at once: to the nearest value, always down, and always up. Useful for prices, measurements and checking spreadsheet results.

How to use Rounding Tool

  1. Enter the Number to round.
  2. Set Decimal places, from 0 to 10.
  3. Compare the Round (to nearest), Floor (always down) and Ceil (always up) results.

How it works

The number is multiplied by 10 to the power of the decimal places, passed through Math.round, Math.floor or Math.ceil, and divided back. Math.round sends an exact half upward toward positive infinity, so 2.5 becomes 3 and −2.5 becomes −2. Floor and ceil move toward negative and positive infinity, so for negatives floor makes the number more negative.

Example

2.4671 to 2 decimal places gives Round 2.47, Floor 2.46 and Ceil 2.47. For −2.4671 the results are −2.47, −2.47 and −2.46.

Questions about Rounding Tool

Why does 1.005 round to 1.00 and not 1.01?

Computers store 1.005 in binary as slightly less than 1.005, so it sits just below the halfway point and rounds down. This tool uses standard floating-point arithmetic and shows that behaviour, as spreadsheets and most languages do.

What is the difference between floor and truncating?

They agree for positive numbers. For negatives, floor goes down, so −2.46 floors to −3 at 0 decimals, while truncating would simply drop the decimals and give −2.

Use it from chat

You do not have to open Rounding Tool to use it. Ask Xenition in plain language and it runs the right tool, then carries the answer into whatever you are working on — a document, a spreadsheet, a deck.

Related tools