JS除法:
/ 除法运算
% 求余运算
如下所示。
常数a=256;
const b=a/100; //b=2.56
const c=a0; //c=56
1. 取整:parseInt():只保留整数位:在这里等同Math.floor()
CONSTd=parseint(b //d=2
2.进一法:Math.ceil():向上取整,有小数就整数部分加1
常数a=125;
常数b=155;
constc=math.ceil(a/100 ); //c=2
CONSTd=math.Ceil(d/100 ); //d=2
3.向下取整:Math.floor()
常数a=125;
常数b=155;
constc=math.floor(a/100 ); //c=1
CONSTd=math.floor(d/100 ); //d=1
4.四舍五入:Math.round()
常数a=125;
常数b=155;
constc=math.floor(a/100 ); //c=1
CONSTd=math.floor(d/100 ); //d=2
-----------------请参阅-----------如果出现问题,wx:wazj-------------0508,及时