숫자 반올림, 올림, 내림
Math 함수 사용
- Math.floor()
- 소수점 이하를 버림
- Math.ceil()
- 소수점 이하를 올림
- Math.round()
- 소수점 이하를 반올림
소수점 n번째 자리 반올림
Math 함수 사용
const pie = 3.14159265358979; Math.round(pie*100)/100.0
toFixed() - 원하는 소수점 길이만큼 반올림하여 변환
const pie = 3.14159265358979; pie.toFixed(2)
[광고] STEEM 개발자 커뮤니티에 참여 하시면, 다양한 혜택을 받을 수 있습니다.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Upvoted! Thank you for supporting witness @jswit.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit