toPrecision

See source code

Get a number to a precision.

function toPrecision(n: number, precision?: number): number

Parameters

NameDescription

n

number

The number.

precision

number

The precision.

Returns

number
Prev
toFixed
Next
uniq