How to delete numbers after a dot JavaScript! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to delete numbers after a dot JavaScript!

I have a number like 3.7. How can I delete the .7? That's the question

26th Dec 2016, 8:42 PM
TheSimonLP YT
TheSimonLP YT - avatar
2 Answers
0
use Math floor Math.floor( 15.5566855) // 15
26th Dec 2016, 8:56 PM
Mofid
Mofid - avatar
0
var x = 3.7; console.log(x | 0);// 3
29th Dec 2016, 12:43 AM
zakaria mouhid
zakaria mouhid - avatar