toFixed()함수를 사용하면 됩니다.


num=123.123456789


num.toFixed(3);

-->결과값: 123.123


num.toFixed(5);

-->결과값:123.12346  반올림됨


+ Recent posts