Created
August 8, 2019 01:24
-
-
Save parzibyte/97a13713f1a5cd93de37773829cd4398 to your computer and use it in GitHub Desktop.
Truncar o remover decimales de número en JavaScript - https://parzibyte.me/blog/2018/09/13/remover-decimales-de-numero-en-javascript/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log(Math.trunc(15)); // 15 | |
console.log(Math.trunc(15.58151)); // 15 | |
console.log(Math.trunc(0)); // 0 | |
console.log(Math.trunc(-0)); // -0 | |
console.log(Math.trunc(100.00)); // 100 | |
console.log(Math.trunc(-150.68)); // -150 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment