Edit in JSFiddle

// Take one zero off the whole number (1000000) used here and the comparison 
// within tolerance of Number.Epsilon will return TRUE

// Even more interestingly, the Number.Epsilon tolerance will work with 100000000 (a larger number)
let f1 = 1000000.1 + 0.2;
let f2 = 1000000.3;
let compareEpsilon = Number.EPSILON;


let calcDifference =  Math.abs(f1 - f2);
let compareResult = calcDifference < compareEpsilon;


// Display pretty result
document.write('<p>Are f1 and f2 approximately equal?: <b>' + compareResult + '</b></p>');

// Display details of why approximate-equality test failed
if (!compareResult) {
	document.write('<p>f1:<br><b>' + f1 + '</b></p>');
	document.write('<p>f2:<br><b>' + f2 + '</b></p>');
	document.write('<p>comparison used epsilon:<br><b>' + compareEpsilon.toFixed(30) + '</b></p>');
  
	document.write('<p>Difference between f1 and f2:<br><b>' + calcDifference.toFixed(30) + '</b></p>'); // 'true'
}
<html>
<head>
<title>Floating Point Approximately-Equal Test</title>
</head>
<body style="background-color:#D0D0D0;">

</body>
</html>