Angular toFixed() not returning expected result

Discussão em 'Angular' iniciado por Ram, Janeiro 8, 2025.

  1. Ram

    Ram Guest

    Please help me find a better solution for the following problem.

    var x = 79.715;
    console.log(x.toFixed(2)); // returns 79.72

    var y = 79.705;
    console.log(y.toFixed(2)); // returns 79.70 though it should be 79.71

    Continue reading...

Compartilhe esta Página