xxxxxxxxxx
19
function setup() {
createCanvas(400, 400);
let num = 840000;
let n = 2
let d = null;
let ree = null;
if (num < 1) {
d = floor(round(log(num))/2)+1
ree = round((num/pow(10, d))*10000)/10000
} else {
d = floor(round(log(num))/2)-n
ree = round((num/pow(10, d))*10000)/10000
}
console.log(ree + "E" + d)
}
function draw() {
background(220);
}