for i = 1, 25 do
print(string.len(tostring(10^i)))
end
Output:
2
3
4
5
6
7
8
9
10
11
12
13
14
5 (x12)
Then, when I do this:
print(string.len("This string is very long. It is longer than the number strings that were just a part of the previous piece of code!"))
Output:
115
Is there an explanation as to why this occurs? I’m trying to make a system that converts a number such as 1234567 into a format such as 1.234567e6, and this is a huge bottleneck.
EDIT: Hold on. The larger numbers are converted into scientific notation. Nevermind