How to get scientific number

It like this : 98,675 = 98.675 x 10 power by 3

i want to do like calculate this on vector3 like 5143 , 534 , 54355 each number/digit are different

you can just use inverse operations, so first we need to make an expression:

n = a * 10^b

where:
n is the number
a is the coefficient
b is the exponent/power

to find a:
a = n/(10^b)

to find b:
b = floor(log10(n))

so we can derive from those to get the a and b:

local b = math.floor(math.log(n, 10))
local a = n/(10^b)

local notation = `{a} x 10^{b}`

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.