function eFinder(number) {
let c = Math.round(number);
let a = c.toString().length - 1;
let b = number.toString().charAt(0);
return `${b}e+${a}`;
}
eFinder(100);
would return 1e+2.
This basically converts any number put in eFinder(); to scientific notation.
Why do you want to implement it by yourself while this is part of JavaScript? Just use
Number.prototype.toExponential()