I have float numbers like 3.2 and 1.6 .(我有漂浮数字,如3.2和1.6 。)
3.2
1.6
3
0.2
n = Math.floor(n);
remainer = n % 2; //obtem a parte decimal do rating
n = 3.1 => remainer = 1.1
Use 1 , not 2 .(使用1 ,而不是2 。)
1
2
js> 2.3 % 1 0.2999999999999998
1.4m articles
1.4m replys
5 comments
57.0k users