Javascript encounters floating point calculation problem

ask for advice, why does the problem of calculation results occur, and how to solve it?

let a = 1.1; 
a += 0.1*1; 
console.log(a);//1.2000000000000002
Mar.16,2021

you have said yourself why such a result occurred, solution

Menu