Local Oriented/HTML CSS JS

수치 parseInt() Math.ceil() Math.floor() Math.round()

래빗 크리스 2014. 4. 10. 08:55

http://bieber1984.blogspot.kr/2014/04/jquery_7.html

- 버림 var and= parseInt(value);
- 올림 var and= Math.ceil(value); 큰 정수값
- 내림 var and= Math.floor(value); 작은 정수값, 소수점이하 버림으로 생각할 수 없는 것이 마이너스쪽을 생각해야 함.
- 반올림 var and= Math.round(value); 사사오입