Skip to main content
Version: Next

round

Description

Round number to precision

Parameters

NameTypeDescription
numnumberNumber
precision?numberPrecision (default 0)

Returns

number rounded number

Examples

turf.round(120.4321);
//=120

turf.round(120.4321, 2);
//=120.43

Installation

$ npm install @turf/helpers

import { round } from "@turf/helpers";
const result = round(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.round(...);