Skip to content

@serenity-is/corelib / round

Function: round()

round(n, d?, rounding?): number

Rounds a number to specified digits or an integer number if digits are not specified.

Parameters

n

number

the number to round

d?

number

the number of digits to round to. default is zero.

rounding?

boolean

whether to use banker's rounding

Returns

number

the rounded number

Defined in

src/base/formatting.ts:245