nround
nround is a term used in numerical computation to denote a rounding operation that produces a value with n digits of precision. The exact behavior of nround is not standardized and can vary by language or library. In some contexts, n refers to the number of digits to the right of the decimal point (decimal places); in others, it refers to the number of significant digits.
Typical implementations provide a function that accepts at least two arguments: the numeric value x and an
Because there is no universal standard, real-world behavior depends on the source. Many languages offer a built-in
Examples (decimal places): nround(3.14159, 2) yields 3.14; nround(3.5, 0) yields 4 under typical half-up rounding.
Examples (significant digits) vary by implementation; some definitions round to n significant digits rather than decimal
Applications include numerical formatting, data presentation, and numerical analysis where controlled precision is required. Potential pitfalls
See also: round, floor, ceil, bankers rounding, significant figures.