Using Math.floor()
is one way of doing this.
More information: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/floor
More Related Contents:
- Javascript: formatting a rounded number to N decimals
- Javascript: Round up to the next multiple of 5
- Rounding numbers to 2 digits after comma
- JavaScript: Round to a number of decimal places, but strip extra zeros
- What exactly does Math.floor do?
- What is JavaScript’s highest integer value that a number can go to without losing precision?
- Formatting a number with exactly two decimals in JavaScript
- Evaluating a string as a mathematical expression in JavaScript
- How do you round to 1 decimal place in Javascript?
- How to find prime numbers between 0 – 100?
- How to transform black into any given color using only CSS filters
- How can I round a number in JavaScript? .toFixed() returns a string?
- Remove insignificant trailing zeros from a number?
- JavaScript exponents
- Is there a way to calculate 3D rotation on X and Y axis from a 4×4 matrix
- Is there a way to round numbers into a reader friendly format? (e.g. $1.1k) [closed]
- Get decimal portion of a number with JavaScript
- Gaussian/banker’s rounding in JavaScript
- In jQuery, what’s the best way of formatting a number to 2 decimal places?
- How do I round a number in JavaScript?
- Mixing two colors “naturally” in javascript
- In JavaScript, why does zero divided by zero return NaN, but any other divided by zero return Infinity?
- How can I convert numbers into scientific notation?
- Why is math.max() returning NaN on an array of integers?
- Why does adding two decimals in Javascript produce a wrong result? [duplicate]
- Display Good-looking Math Formula in Android
- Extracting the exponent and mantissa of a Javascript Number
- round off decimal using javascript
- Javascript Math Error: Inexact Floats [duplicate]
- How to calculate with imaginary numbers in JavaScript?