Skip to content

round

const round: (number: number, ndigits?: number) => number = builtins.round

Defined in: packages/pythonlib/src/index.ts:169

Round a number to a given precision in decimal digits.

Uses banker’s rounding (round half to even) for values exactly halfway.

Parameters

ParameterTypeDescription
numbernumberThe number to round
ndigits?numberNumber of decimal places (default: 0)

Returns

number

The rounded number

See

Python round()