Family. All three share Lodash’s precision helper.
Compatibility
Browser & Runtime Support
_.floor is a Lodash 4.x Math helper (since 3.10.0). It builds on native Math.floor plus Lodash number coercion.
✓ Stable · Lodash 3.10.0+
_.floor()
Available in [email protected] full builds and the lodash/floor modular import. Works in evergreen browsers and Node / Bun / Deno when Lodash is installed.
100%With Lodash 4.x
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
_.floorLodash 4.x+
Bottom line: Safe for production once Lodash is on the page or in your bundle. Prefer import floor from "lodash/floor" for smaller builds.
Frequently Asked Questions
_.floor(number, [precision=0]) rounds number down (toward −Infinity) to the given precision. With precision 0 it matches Math.floor for finite numbers.
Positive precision keeps that many decimal places (rounded down). Negative precision rounds down to tens (−1), hundreds (−2), and so on — e.g. _.floor(4060, -2) → 4000.
floor always rounds toward −Infinity. ceil rounds toward +Infinity. round goes to the nearest value.
Yes. _.floor(-4.1) → -5 because -5 is less than -4.1 (toward −Infinity).
Yes. The value is passed through toNumber, so _.floor('4.9') → 4. Non-numeric strings become NaN.
Use import floor from "lodash/floor" or require("lodash/floor") for tree-shaking. Full build: import _ from "lodash" then _.floor.