I need to convert a decimal value into 18 digit number. I am using Javascript Exponentiation operator for this. But in some cases, it throws wrong number. What would be the perfect solution for this scenario.
Ex:
const input = 0.00204475;
const output = input * 10 ** 18
console.log(output);
From above example, I need output like
2044750000000000
But I am getting
2044750000000000.2