0

How could I round a number down to the ones place in JavaScript?

Is there a keyword or something?

20th Feb 2019, 11:53 PM
Hadyn Casler
Hadyn Casler - avatar
2 Réponses
+ 10
Or if you want something like 3.14159 => 3.1 Have a look ~ https://www.sololearn.com/Discuss/264815/?ref=app
21st Feb 2019, 5:55 AM
Nikhil
Nikhil - avatar
+ 5
To round down, use Math.floor or ~~ (e.g. ~~(3.141592653) = 3). To round up, use Math.ceil.
21st Feb 2019, 5:43 AM
Rowsej
Rowsej - avatar