_.round is a Lodash 4.x Math helper (since 3.10.0). It builds on native Math.round plus Lodash number coercion. It runs anywhere Lodash runs — modern browsers (CDN or bundle) and Node.js / Bun / Deno with npm install lodash.
✓ Stable · Lodash 3.10.0+
_.round()
Available in [email protected] full builds and the lodash/round modular import. Works in evergreen browsers and current Node LTS when Lodash is installed.
100%With Lodash 3.10+
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
BunSupported · JavaScript runtime
Supported
DenoSupported · JavaScript runtime
Supported
Node.jsSupported · Server runtime
Supported
Android WebViewSupported · Modern WebView
Full support
_.roundLodash 3.10.0+
Bottom line: Safe for production once Lodash is loaded. Prefer import round from "lodash/round" for smaller bundles. Use it whenever you need nearest-value rounding with precision.
Frequently Asked Questions
_.round(number, [precision=0]) rounds number to the nearest value at the given precision. With precision 0 it behaves like Math.round for finite numbers.
Positive precision keeps that many decimal places. Negative precision rounds to tens (−1), hundreds (−2), and so on — e.g. _.round(4060, -2) → 4100.
round goes to the nearest value. ceil rounds toward +Infinity. floor rounds toward −Infinity.
Like Math.round: toward +Infinity. So _.round(0.5) → 1 and _.round(-0.5) → -0. This is not banker's (half-to-even) rounding.
The multiply/divide pattern can lose precision (e.g. 1.005). Lodash uses an exponential-shift approach so _.round(1.005, 2) → 1.01.
Use import round from "lodash/round" or require("lodash/round") for tree-shaking. Full build: import _ from "lodash" then _.round.