I made tonumber(string)
but this number is so big, so number value transfering to e+1…
I want dont transfer how ?
edit–>
local a = “13412319013213”
local b = tonumber(a)
print(tonumber(a) == b)
print(tostring(b) == a)
Output
true
false
I made tonumber(string)
but this number is so big, so number value transfering to e+1…
I want dont transfer how ?
edit–>
local a = “13412319013213”
local b = tonumber(a)
print(tonumber(a) == b)
print(tostring(b) == a)
Output
true
false
Lua normalises finite IEEE-754 doubles that’s not in the range of +/- 10-5 to 1013(IIRC) into the e
notation.
You can use %.0f
for this but just be aware that it’ll lose some precision.