Skip to content

Commit

Permalink
Fixed order of units
Browse files Browse the repository at this point in the history
  • Loading branch information
m4skedbyte committed Sep 16, 2020
1 parent 21ab523 commit 64929c5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions nconvert.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ local w = screen:width()
title = "Unit:" --title

unit = "MiB" --unit (default MiB)
unit_count = 1
unit_count = 3
input = "" --input
noinputmsg = "Please enter a value"

Expand Down Expand Up @@ -146,20 +146,20 @@ function on.arrowRight()
end

if unit_count == 1 then
unit = "MiB"
unit = "TiB"
end
if unit_count == 2 then
unit = "KiB"
unit = "GiB"
end
if unit_count == 3 then
unit = "Bytes"
unit = "MiB"
end
if unit_count == 4 then
unit = "GiB"
unit = "KiB"
end
if unit_count == 5 then
unit == "TiB"
end
unit = "Bytes"
end
screen:invalidate()
end

Expand All @@ -171,20 +171,20 @@ function on.arrowLeft()
end

if unit_count == 1 then
unit = "MiB"
unit = "TiB"
end
if unit_count == 2 then
unit = "KiB"
unit = "GiB"
end
if unit_count == 3 then
unit = "Bytes"
unit = "MiB"
end
if unit_count == 4 then
unit = "GiB"
unit = "KiB"
end
if unit_count == 5 then
unit = "TiB"
end
unit = "Bytes"
end
screen:invalidate()
end

Expand All @@ -196,6 +196,6 @@ function on.tabKey() --reset
answer[3] = ""
answer[4] = ""
unit = "MiB"
unit_count = 1
unit_count = 3
screen:invalidate()
end

0 comments on commit 64929c5

Please sign in to comment.