Round to n decimal places

Type x and k places. The calculator rounds x to k places (k cut down) and shows k decimal places. 3.14159 and 2 give 3.14. 2.5 and 0 give 3. 1.005 and 2 give 1.00.

The result is a k-place string after rounding x to k places (k cut down). 1.005 at 2 places comes out 1.00, because that is machine float rounding, not school 1.01.

Input data

Results

Enter data and click Calculate.

How it works

Rounding to n places shortens x to k digits after the point. With 3.14159 and k = 2 school writes 3.14. The calculator rounds x to k places (k cut down), then k places again on the result, so the result is 3.14 with a dot and two digits.

k = 0 eats the whole fraction. 2.5 and 0 give 3, because rounding to 0 places of 2.5 is “3”. The display is “3” again, because k places is zero.

The fields are x and k. A negative k is treated as 0 (a negative k becomes 0). A comma in x works. 1.005 and k = 2 give 1.00, not 1.01. In machine float, 1.005 is not a clean 1 + 5/1000, so two decimal places fall to 1.00. Not a second formula, only this engine.

Floor and ceil go to an integer and never ask for k. Here k stays in the result: at 2 places you see two digits, even when they are zeros, as in 1.00.

School often teaches “5 goes up”. This calculator does not promise banker's rounding or the school half. It promises browser rounding.

3.14159 and 2 give 3.14. 2.5 and 0 give 3. 1.005 and 2 give 1.00. Rounding cuts to the places on the page.

Formula

result = x rounded to max(0, ⌊k⌋) places, shown with k digits

How to use

  1. Type x, for example 3.14159, and k, for example 2.
  2. Click Calculate. The result is 3.14.
  3. 2.5 and k = 0 give 3.
  4. 1.005 and k = 2 give 1.00, not 1.01.
  5. Floor and ceil of that x live on the neighbouring cards, with no k.

3.14159 and 2 give 3.14

The calculator rounds x to k places (k cut down) and shows k decimal places. 3.14159 and 2 give 3.14. 2.5 and 0 give 3. 1.005 and 2 give 1.00.

places
The second field, k. 2 leaves two digits, hence 3.14 and 1.00. 0 eats the fraction.
places on the page
The calculator engine. Rounds x to k places (k cut down), then k places again. 1.005 at 2 is 1.00.
round
Shorten x to k digits, not floor and not ceil. 2.5 at k = 0 gives 3.

Examples

Example 1

  • x = 3.14159
  • k = 2

3.14

What is 3.14159 to 2 places? 3.14. The calculator keeps a dot and two digits.

Example 2

  • x = 2.5
  • k = 0

3

What is 2.5 to 0 places? 3. rounding to 0 places of 2.5 is a three.

Example 3

  • x = 1.005
  • k = 2

1.00

What is 1.005 to 2 places? 1.00, not 1.01. That is machine float rounding.

Related calculators

Common questions

What is 3.14159 to 2 places?

3.14. Round to two places, then two places again on the result.

What does round to n decimal places mean?

Shorten x to k digits after the point. k is the second field. The calculator keeps k digits, including zeros.

What is 2.5 to 0 places?

3. rounding to 0 places of 2.5 gives the string 3.

Why do 1.005 and 2 give 1.00?

1.005 is not clean in machine float. two decimal places fall to 1.00, not school 1.01.

What if k is negative?

A negative k is treated as 0. You are left with rounding to an integer.

How is this different from floor?

Floor always eats the fraction toward −∞. Here k can leave 3.14.

Does a comma in 3.14159 work?

Yes. 3.14159 and 3,14159 at k = 2 both give 3.14.

Does the calculator promise “5 goes up”?

No. It promises browser rounding, not a notebook rule.

Why 1.00, not 1?

The display calls k decimal places. At k = 2 the two zeros stay.

Where is ceil?

On the ceiling page. There is no k there.

Knowledge sources

The calculator computes the same formula as the definition below.

Page updated in 2026.