+ 3
How can i get the answer 1 when i divide 1200 to 1000?
Im using the var keyword and still return 1.2, also i used int but i got an error? should i convert it to int? please help.
5 ответов
+ 1
use Math.floor
+ 2
Hi @Masshan
You are right, if you talk about C++, unfortunately not in Javascript.
+ 2
@Calvin thankyou bro. it works!
+ 1
as how I know 1.2 should be float type variable and as int type variables are not supposed to return numbers with a decimal places you get 1 as the answer. (I'm a newbie)
0
@calvin thanks bro 😊