You can round numbers to a certain number of decimals using toFixed method from native javascript.
toFixed
let pie = 3.141592653; pie = pie.toFixed(3); // 3.142