0

Here is my code

var x = .06;
var y = x * 100;

var x2 = .07;
var y2 = x2 * 100;


console.log(y)  // output is 6, as expected

console.log(y2) // output 7.000000000000001, why not just 7?

Why i am getting 7.000000000000001 instead of 7. How to get 7?

mahfuj asif
  • 1,691
  • 1
  • 11
  • 32

0 Answers0