InterviewHubPRO
Section Overview
Q372

Question 372 of 521

Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

71%
JavaScript Internals (521 Qs)•Part 6: Async Internals, Memory, Microtasks & Web APIs (329 - 403)

How do you round numbers to certain decimals

You can round numbers to a certain number of decimals using toFixed method from native javascript.

javascript
  let pie = 3.141592653;
  pie = pie.toFixed(3); // 3.142