[JS] 소수점 출력 js에서 number를 출력하면 기본적으로 소수점이 0일때는 버리고 출력됩니다 소수점을 출력할 땐 toFixed로 소수점 자릿수를 지정해주면 됩니다 ex) const n = 4.0; console.log(n); //4 console.log(n.toFixed(1)); // 4.0 프로그래밍/JS,TS 2023.04.24