calculator whitespace adjustments
This commit is contained in:
parent
aaff61a0cb
commit
e69293d514
@ -59,22 +59,18 @@ laptop.register_app("calculator", {
|
||||
local data = mtos.bdev:get_app_storage('ram', 'calculator')
|
||||
local entry = data.tab[#data.tab]
|
||||
|
||||
if fields.constant_pi then
|
||||
entry.var2 = tostring(math.pi)
|
||||
end
|
||||
if fields.constant_e then
|
||||
entry.var2 = tostring(math.exp(1))
|
||||
end
|
||||
if fields.rnd then
|
||||
entry.var2 = tostring(math.random())
|
||||
end
|
||||
|
||||
if fields.number then
|
||||
-- simple number entry. With check for valid value
|
||||
local new_val = (entry.var2 or "")..minetest.strip_colors(fields.number)
|
||||
if tonumber(new_val) then
|
||||
entry.var2 = new_val
|
||||
end
|
||||
elseif fields.constant_pi then
|
||||
entry.var2 = tostring(math.pi)
|
||||
elseif fields.constant_e then
|
||||
entry.var2 = tostring(math.exp(1))
|
||||
elseif fields.rnd then
|
||||
entry.var2 = tostring(math.random())
|
||||
elseif fields.del_char then
|
||||
-- delete char
|
||||
if entry.var2 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user