The goal is to isolate the decimal value (with simply turning the integer into a string and splitting it).
To that affect I have:
var x = 1001.1;
var roundedDown = Math.floor(x); // Produces 1001
var decimal = x - roundedDown;
The expected value of decimal
should be 0.1 (1001.1 - 1001). But instead I get 0.0999999 recurring.
I have tried with Math.trunc
as well but get the same results.
Would anyone know why this is?