Hello I have problem with a simple function in JavaScript if I add 0.0001 + 0.0001 + 0.0001 i have 0.0002999999999999999999 I don't know why because it's simple Number(x) + Number(y).
With php I use this function and it's work perfectly
$number = number_format($number, 10, '.', '');
$number = rtrim(rtrim($number, '0'), '.');
What is the equivalent of this script PHP in Javascript?