The toFixed() method of a Number converts it to a string and rounds that to a specified number of decimals.

    
    const number = 5.56789;

    const numberToFixed = number.toFixed();

    console.log(numberToFixed);
    // "6"

    const numberToFixed3 = number.toFixed(3);

    console.log(numberToFixed3);
    // "5.568"