Module:Math: Difference between revisions
no edit summary
m>Dragons flight No edit summary |
m>Dragons flight No edit summary |
||
Line 26: | Line 26: | ||
local decimal = string.find( x, '.', 1, true ) | local decimal = string.find( x, '.', 1, true ) | ||
local | local exponent_pos = string.find( x, 'E', 1, true ) | ||
local result = 0; | local result = 0; | ||
if | if exponent_pos ~= nil then | ||
exponent = string.sub( x, | local exponent = string.sub( x, exponent_pos + 1 ) | ||
x = string.sub( x, 1, | x = string.sub( x, 1, exponent_pos - 1 ) | ||
result = result - tonumber( exponent ) | result = result - tonumber( exponent ) | ||
end | end |