Skip to content

round

Return number rounded to precision.

Usage

ts
import { round } from 'rattail'

round(1.005) // return 1
round(1.005, 2) // return 1.01

Arguments

ArgTypeDefaults
valnumber
precisionnumber0

Return

Type
number