Skip to main content

round

Computes number rounded to precision.

API

function round(number: number, precision?: number): number;

Usage

import { round } from '@feedzai/js-utilities';

round(4.006)
// => 4

round(4.006, 2)
// => 4.01

round(4060, -2)
// => 4100