• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
JavaScriptSource

JavaScriptSource

Search 5,000+ Free JavaScript Snippets

  • Home
  • Browse Snippets
    • Addon
    • Ajax
    • Buttons
    • Cookies
    • CSS
    • Featured
    • Forms
    • Games
    • Generators
    • Image Effects
    • Math Related
    • Miscellaneous
    • Multimedia
    • Navigation
    • Page Details
    • Passwords
    • Text Effects
    • Time & Date
    • User Details
Home / Math Related / Return the largest integer less than or equal to a number

Return the largest integer less than or equal to a number

Return the largest integer less than or equal to a number

Returns the largest integer (whole number) less than or equal to a number.

// returns 42
Math.floor(42);

// returns 3
Math.floor(3.14);

// Returns -4
Math.floor(-3.14);

Source

https://vanillajstoolkit.com/reference/numbers/math-floor/

Math Related

Related Snippets:

  • Amazing Quadratic Equation Solver
  • Quartic Equation Solver
  • Circumference Calculator
  • Distance Speed Time

Primary Sidebar

Popular Posts

Story Generator

IP Grabber – get a users IP address with JavaScript

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2025 JavaScriptSource.com

  • About
  • Privacy Policy
  • FAQ
  • Jobs For Developers