How to delete numbers after a dot JavaScript! | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponses
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