round
Description
Round number to precision
Parameters
Name | Type | Description |
---|---|---|
num | number | Number |
precision? | number | Precision (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(...);